Unable to load model weights error

Hi team,

Please forgive me if I am asking a really stupid question as I am brand new to Streamlit.

I am trying to load a PyTorch model to Streamlit from Github but somehow Streamlit returns an error like:

OSError: Unable to load weights from pytorch checkpoint file for ‘cuad-training/cuad-models/’ at 'cuad-training/cuad-models/pytorch_model.bin’If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.

I do have a PyTorch model saved under the folder ‘cuad-training/cuad-models/’. No idea why it cannot be loaded. Everything works fine when running the program locally though. The model was uploaded and stored earlier by git lfs. But I am not certain whether this is the cause and do not know how to deal with this now :frowning:

https://share.streamlit.io/zhaosang/lalaland/main

Thank you in advance for your help!!!

Ray

1 Like

Hi @ZhaoSang, and welcome to the Streamlit forum! :balloon:

I’ve not never personally tried yet the issue is likely to do with either maxed out Git LFS bandwidth/storage quota or file corruption during upload via Git LFS.

In case you’re still experiencing the issue, would you mind trying again in light of the above?

Best,
Charly

cc: @snehankekre

1 Like

Hey @Charly_Wargnier. Thank you for your help! I figured out why it went wrong earlier. when I used git lfs…I forgot to add the git lfs attributes to Github…

Thanks again!

1 Like

Glad you managed to sort it Zhao! :raised_hands: