Spaces:
Runtime error
Runtime error
addpredictfunction
#1
by
tp2422
- opened
- app.py +4 -13
- requirements.txt +0 -1
app.py
CHANGED
@@ -1,16 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
-
from fastai.vision.all import *
|
3 |
|
4 |
-
|
|
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
def predict(img):
|
10 |
-
img = PILImage.create(img)
|
11 |
-
pred, pred_idx, probs = learn.predict(img)
|
12 |
-
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
13 |
-
|
14 |
-
|
15 |
-
gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(512, 512)),
|
16 |
-
outputs=gr.outputs.Label(num_top_classes=2)).launch()
|
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
+
def greet(name):
|
4 |
+
return "Hello " + name + "!!"
|
5 |
|
6 |
+
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
+
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
fastai
|
|
|
|