ronniet commited on
Commit
18d8458
1 Parent(s): 12a6969

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -1,5 +1,19 @@
1
  import gradio as gr
 
2
 
3
- gr.Interface.load("models/ronniet/git-base-env").launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  # gr.Interface.load("models/microsoft/git-base").launch()
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
 
4
+ captioner = pipeline(model="microsoft/git-base")
5
+
6
+ def predict(image):
7
+ return captioner(image)[0]["generated_text"]
8
+
9
+ demo = gr.Interface(
10
+ fn=predict,
11
+ inputs=gr.Image,
12
+ outputs='text'
13
+ )
14
+
15
+ demo.launch()
16
+
17
+ # gr.Interface.load("models/ronniet/git-base-env").launch()
18
 
19
  # gr.Interface.load("models/microsoft/git-base").launch()