Assistance with GitHub and GitLFS for Streamlit Deployment

I’m experiencing an issue while deploying a model on Streamlit. I uploaded my .h5 model file to GitHub, but because it was larger than 25 MB, I used Git Large File Storage (GitLFS). When I try to access this file through my Streamlit app, I get the following error message:

OSError: Unable to synchronously open file (file signature not found)
When I download the .h5 file locally, it works fine. This suggests that the problem might be with GitLFS or how I’m accessing the file through Streamlit.
Would you be able to help me understand why this error is occurring and how I can resolve it? Any guidance or suggestions would be greatly appreciated.

Hello @ResearchGroup, welcome to the community! :hugs:

Just a heads-up about GitLFS on Streamlit Cloud—it’s supported, but there could be some limitations on file sizes. I believe you might need some credits for larger downloads.

Did you give it a shot with smaller files?

Best,
Charly

Hi Charly,

Thanks for the heads-up! Yes, I tested it with smaller files, and it works okay.
Could you guide me on how to obtain credits for larger downloads?

No worries!

You may find what you’re after here:

Are you sure, that you have setup GitLFS properly?
Did it even work once when you did a clone/checkout of the github repo?
Afaik you need a .gitattributes file in the repo.


1 Like

Yes, I have successfully setup GitLFS to clone the repository before. Also, I’ve had good results using Streamlit with GitHub for handling small files that were uploaded directly through GitHub. Everything seems to be configured correctly on that front.