KeyError 118

I am trying to deploy my app and receive KeyError 118. I used a joblib file to pickle my model and that seems to be the issue, but I’m not sure why.

Hey @akhan390,

Are you deploying your app on Streamlit Sharing (if not where are you deploying it)? Can you put your github link and a screen shot of the error longs your getting when you try and deploy?


I have the same issue @Marisa_Smith .

Error is as above KeyError: 118

File "/usr/local/lib/python3.7/site-packages/streamlit/", line 332, in _run_script
    exec(code, module.__dict__)
File "/app/ontimeperformance/", line 43, in <module>
    model = load_model('Randomforestmodel')
File "/home/appuser/.local/lib/python3.7/site-packages/pycaret/", line 2149, in load_model
File "/home/appuser/.local/lib/python3.7/site-packages/pycaret/internal/", line 8966, in load_model
    model_name, platform, authentication, verbose
File "/home/appuser/.local/lib/python3.7/site-packages/pycaret/internal/", line 373, in load_model
    return joblib.load(model_name)
File "/home/appuser/.local/lib/python3.7/site-packages/joblib/", line 585, in load
    obj = _unpickle(fobj, filename, mmap_mode)
File "/home/appuser/.local/lib/python3.7/site-packages/joblib/", line 504, in _unpickle
    obj = unpickler.load()
File "/usr/local/lib/python3.7/", line 1088, in load

GitHub link to the app and model (GitHub - wandabwa2004/OntimePerformance: Ontime Trains Performance model)

I’m not sure of what I’m doing wrong. A few things :-

  1. The model is about 200MB and I uploaded via Git-LFS. I did a Git Pull just to check whether the model format changed but seems be the same.
  2. A smaller model i.e. 19MB works but it lacks many features compared to the updated model.

Is size the issue? I don’t think I’ve utilized the entire 800MB that’s allowed.

Hey @wandabwa2004,

I think I know what the issue is here, right now Streamlit Sharing doesn’t support the git-lfs.

Check out this forum post for more details:


Thank you @Marisa_Smith. I’ll look at other ways of making the model accessible as I await Streamlit updates on this.

1 Like

Git LFS should have gone out in the Streamlit sharing release this evening, please try it out and let us know if you have any issues.