Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ from transformers import pipeline
|
|
| 6 |
# image2text
|
| 7 |
def img2text(img):
|
| 8 |
image_to_text_model = pipeline("image-to-text",
|
| 9 |
-
model="
|
| 10 |
text = image_to_text_model(img)[0]["generated_text"]
|
| 11 |
return text
|
| 12 |
|
|
|
|
| 6 |
# image2text
|
| 7 |
def img2text(img):
|
| 8 |
image_to_text_model = pipeline("image-to-text",
|
| 9 |
+
model="nlpconnect/vit-gpt2-image-captioning")
|
| 10 |
text = image_to_text_model(img)[0]["generated_text"]
|
| 11 |
return text
|
| 12 |
|