Anniek commited on
Commit
1a8bb86
·
1 Parent(s): fd58dd9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -1,8 +1,8 @@
1
- import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello " + name + "!"
5
 
6
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
 
8
- demo.launch()
 
 
 
 
1
 
2
+ from transformers import pipeline
 
3
 
4
+ image_to_text = pipeline("image-to-text", model="nlpconnect/vit-gpt2-image-captioning")
5
 
6
+ image_to_text("https://ankur3107.github.io/assets/images/image-captioning-example.png")
7
+
8
+ # [{'generated_text': 'a soccer game with a player jumping to catch the ball '}]