Error when using gradio, fastai on Hugging Face Space


I followed lesson 2 and created a Gradio app, which works on my laptop.

However after pushing it to a Huggingface Gradio Space the build ends with an error:
ModuleNotFoundError: No module named ‘fastai’

I tried:
import os
os.system(‘pip install fastai’)
That results in an error as well.

What is required to get a Space with fastai and gradio installed? Or is there a different way?


found it.
For dependencies you need to add the file “requirements.txt” It contains “fastai”


I highly recommend you finish till the end huggingface interface (API endpoint). Gradio says it ] works for 72 hours it did not for me. Huggingface actually works even after a month. A great place to show your work.

Where I can find the “requirements.txt”?

Hi, here is my requirement.txt that I used for the deployment.


Thank you very much! I already push the model to my Space on huggingface and it works!


I’m glad it worked!
Now you can share your work on this post if you don’t mind so that everyone can check it out! :smile: