spuun commited on
Commit
c2c8125
1 Parent(s): e607d4a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -4,4 +4,8 @@ from transformers import pipeline
4
  model_id = "Salesforce/blip-image-captioning-large"
5
  captioner = pipeline(model=model_id)
6
 
7
- gr.Interface.from_pipeline(captioner).launch()
 
 
 
 
 
4
  model_id = "Salesforce/blip-image-captioning-large"
5
  captioner = pipeline(model=model_id)
6
 
7
+ def launch(input):
8
+ return captioner(input)[0]["generated_text"]
9
+
10
+ iface = gr.Interface(fn=launch, inputs="pil", outputs="text")
11
+ iface.launch()