Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,23 @@
|
|
1 |
from dotenv import find_dotenv, load_dotenv
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
load_dotenv(find_dotenv())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from dotenv import find_dotenv, load_dotenv
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
load_dotenv(find_dotenv())
|
5 |
+
|
6 |
+
# img2text
|
7 |
+
def img2text(url):
|
8 |
+
image_to_text_model = pipeline("image-to-text", model="nlpconnect/vit-gpt2-image-captioning")
|
9 |
+
text = image_to_text_model(url)
|
10 |
+
|
11 |
+
print(text)
|
12 |
+
return text
|
13 |
+
|
14 |
+
img2text("test.jpg")
|
15 |
+
# make the story of it using LLM
|
16 |
+
|
17 |
+
|
18 |
+
|
19 |
+
# text to speech
|
20 |
+
|
21 |
+
|
22 |
+
|
23 |
+
|