Deployment issues: is inference with large models like BART possible?


I am having trouble deploying my news summarisation app. Originally I had requirements issues related to pytorch (required for transformers) but these appear to have been fixed according to the latest logs.

Despite receiving no errors and it being in my requirements.txt file, it looks like newsapi hasn’t installed?

Any help would be much appreciated.

Hi @jamie.dorri,

Welcome to our Streamlit Community! :partying_face: :partying_face: :partying_face: :partying_face: :partying_face: :tada:

Without a link to your github repo we won’t be able to help you debug this (there could be many things happening), can you link your repo here please?


1 Like

Sorry, I fixed this (newsapi-python not newsapi is the package name), but now having with the pytorch backend (a Nvidia driver issue). To be clear, I am performing only CPU inference. Are you able to see my requirements file?

Sorry, yeah, it’s here:


So on this one do you get an error when you’re trying to deploy? I am able to see your requirements file now thanks!


Yes, I do. Here is the error:

/home/appuser/.local/lib/python3.7/site-packages/torch/cuda/ UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from (Triggered internally at /pytorch/c10/cuda/CUDAFunctions.cpp:100.)

I originally installed torch via transformers[torch] but modified the req file to work with streamlit sharing. Maybe I can fix this with the +cpu syntax, i.e., torch==1.7.0+cpu

My Streamlit app works locally. Don’t worry, I will get to the bottom of it eventually!

I’ve fixed these on my side now using the +cpu change. However, the app is crashing when I try to perform inference.

Is this a memory error? I’m using transformer’s bart-large-cnn model (1.6GB). Here is an example of an Streamlit app using large NLP models successfully, showing its possible:

Thanks again!