nhenseler
(Norbert Henseler)
August 31, 2022, 3:28am
1
Hi,
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?
thanks
Norbert
2 Likes
nhenseler
(Norbert Henseler)
August 31, 2022, 3:53am
2
found it.
For dependencies you need to add the file “requirements.txt” It contains “fastai”
5 Likes
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.
G4ston
(Gastón)
November 8, 2022, 3:26pm
4
Where I can find the “requirements.txt”?
galopy
November 8, 2022, 10:17pm
5
Hi, here is my requirement.txt that I used for the deployment.
3 Likes
G4ston
(Gastón)
November 9, 2022, 1:35pm
6
Thank you very much! I already push the model to my Space on huggingface and it works!
2 Likes
galopy
November 9, 2022, 2:54pm
7
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!
1 Like
Hi, i am getting this error even after using requirements.txt
Runtime error
Traceback (most recent call last): File “app.py”, line 7, in from fastai.vision.all import * ModuleNotFoundError: No module named ‘fastai’
DeanSingh
(Dean Singh)
June 6, 2023, 7:44pm
9
Did you ever figure this out ?
Farai
(Farai)
June 22, 2023, 4:16pm
10
You need to go into your Space and find the “App” tab, next to it is a “File” tab:
click on “File”, then click “Add file”.
An editor opens up.
enter file name as “requirements.txt”
in the body, type “fastai”
then complete by clicking “create file”
2 Likes
edenzo
(Eden Zohar)
July 12, 2023, 6:33am
11
me too, did you figure this out ?
Farai, I could be wrong, but check that the fastai module is installed.
I was running the code locally and had to therefore install the fastai module locally.
Go to the environment that you’ve created and use pip install -Uqq fastai
tyatsenk
(Tetyana Yatsenko)
December 27, 2023, 6:42pm
13
Thanks!
adding requirements.txt with fastai did the trick!
Hi all,
I’ve been facing this error-
AttributeError: module 'gradio' has no attribute 'inputs'
Here’s the hugging face space - Minima - a Hugging Face Space by ShubhranshuArya
vbakshi
(vishal_learner)
May 30, 2024, 7:23pm
15
Looking at their GitHub repo examples looks like you should try replacing:
image = gr.inputs.Image(shape=(192,192))
with:
image = gr.Image(shape=(192, 192))
Thanks a lot @vbakshi for such a prompt reply. I solved the issue.
You were right, but one more correction, the ‘shape’ value has been replaced with ‘height’ and ‘weight’. So the command now looks like this
image = gr.Image(width=200, height=200)
2 Likes