hdchild commited on
Commit
6ad80d9
·
1 Parent(s): 16fa697

bear classification

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -1,7 +1,12 @@
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()
 
1
  import gradio as gr
2
+ from huggingface_hub import from_pretrained_fastai
3
 
 
 
4
 
5
+ learner = from_pretrained_fastai("hdchild/bear")
6
+
7
+ def predict(image):
8
+ return learner.predict(image)[0]
9
+
10
+
11
+ iface = gr.Interface(fn=predict, inputs="image", outputs="text", capture_session=True)
12
  iface.launch()