Dependency issues on deployed apps despite providing environment.yml file

Hi,
I had successfully deployed an app on Streamlit cloud which had been active for a while. But on checking now, the following error shows up:
My environment.yml mentions the transformers package as a dependency and the app was running after deployment. Why does it show this error now?

[19:00:50] πŸ“¦ Processed dependencies!


Collecting usage statistics. To deactivate, set browser.gatherUsageStats to False.





2023-09-16 07:47:10.316 Uncaught app exception

Traceback (most recent call last):

  File "/home/adminuser/venv/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script

    exec(code, module.__dict__)

  File "/mount/src/nlg-arxiv-abstractgenerator/app.py", line 2, in <module>

    from infer import Inference

  File "/mount/src/nlg-arxiv-abstractgenerator/infer.py", line 2, in <module>

    from transformers import GPT2Tokenizer, GPT2LMHeadModel

ModuleNotFoundError: No module named 'transformers'```

Maybe there is a mismatch between the python version and the packages you nailed in your environment.yml file.
Try this:

requirements.txt

pandas
scikit-learn
torchvision==0.13.0
torch==1.12.0
torchaudio==0.12.0
streamlit==1.15.2
transformers==4.20.1

Should I add these in a separate requirements.txt file in addition to the existing environment.yml file?

No, replace it and try if this works.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.