Streamlit data limit

He Folks,

I tried to load some small amount of data and get the following error:
RuntimeError: Data of size 73.8MB exceeds write limit of 50.0MB
Any ideas how to fix it?

Cheers
Chris

What version of Streamlit are you using? Old versions used to have a limit of 50MB for file_uploader, but changed to 200MB by default a while back.

To change that limit, you can change the following configuration:

# Max size, in megabytes, for files uploaded with the file_uploader.
# Default: 200
maxUploadSize = 200

https://docs.streamlit.io/en/stable/streamlit_configuration.html#view-all-configuration-options

3 Likes

Great post! Do any of you know what is the max storage for reading a writing files locally using Streamlit? or does that depend on the deployment service provider such as Heroku?

Yeah, that’s mostly the case. The important thing to realize about Streamlit is that there are very few limitations that aren’t browser limitations, or Python limitations. Meaning, the file_uploader limitation of 200MB is just a placeholder to keep people from uploading a 1 TB file. If your instance can handle that, and the Python tornado back-end will let you and the browser will let you
then go ahead and change that number :slight_smile:

Same thing with passing huge data volumes from Python to the front-end
there are some artificial limits in place, so that you don’t try to render a 10GB dataframe as HTML, because that’s probably not what you mean.

So whenever a limit comes up with Streamlit the core Python library, it’s instructive to take a step back and think about your specific use case. In the terms of free hosting, whether Streamlit sharing or Heroku, it’s usually a reflection about cost containment (it certainly is for us in the near-term!)

Best,
Randy

3 Likes

Hi Randy, thanks for your help in advance.

I had this same error, but my dataframe is around 10MB and the error message I get is:
RuntimeError: Data of size 57.9MB exceeds write limit of 50.0MB

I’m not sure where the app is getting 57.9MB from. I checked the config file and upped the maxuploadsize to 300 and I still get the same error.

Any ideas what I should do?

Could you confirm what version of streamlit you are using, please?

It would also be useful to confirm “streamlit config show” has your update in it.

Same issue here as Math.

I’m running a conda venv, if I run the config check it shows I’ve set the max upload size to 500. The only way I figured to fix this was by editing some file a user had mentioned in finding within the library module its self.

Unfortunately, now I started a new venv and have to find that post again!

I’m not an engineer by trade, the whole config.toml has given me more hiccups than anything else with streamlit thus far.

Okay, ironically, I took a few to read the config setup a bit better and realized I needed to actually create the config.toml within my cwd. (it was using my global config.)

Now, when I run ‘streamlit config show’ I can see the config file is reading from within my file. I can update the port number, it all appears to work fine. The issue is still the max size isn’t working even though it appears to be reflecting properly within the config file
not sure what gives.