Update Home.py
Browse files
Home.py
CHANGED
|
@@ -8,14 +8,16 @@ from transformers import pipeline, Conversation
|
|
| 8 |
# txtgen = pipeline(task="text-generation", model="EleutherAI/gpt-neo-2.7B")
|
| 9 |
# txtclassifi = pipeline(task="text-classification", model="nlptown/bert-base-multilingual-uncased-sentiment")
|
| 10 |
# summurize = pipeline(task="summarization", model="sshleifer/distilbart-cnn-12-6")
|
| 11 |
-
visualqna = pipeline(task="vqa", model="microsoft/DialoGPT-medium")
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
def load_image():
|
| 15 |
with st.sidebar:
|
| 16 |
img = st.text_input("Enter Image URL")
|
| 17 |
if st.button("Load Image"):
|
| 18 |
-
st.
|
|
|
|
| 19 |
return img
|
| 20 |
|
| 21 |
# def homepage():
|
|
@@ -79,6 +81,7 @@ def load_image():
|
|
| 79 |
def visual_qna():
|
| 80 |
st.title("Visual Q&A")
|
| 81 |
img = load_image()
|
|
|
|
| 82 |
if img:
|
| 83 |
if query := st.chat_input("Enter your message"):
|
| 84 |
response = visualqna(question=query, image=img)
|
|
|
|
| 8 |
# txtgen = pipeline(task="text-generation", model="EleutherAI/gpt-neo-2.7B")
|
| 9 |
# txtclassifi = pipeline(task="text-classification", model="nlptown/bert-base-multilingual-uncased-sentiment")
|
| 10 |
# summurize = pipeline(task="summarization", model="sshleifer/distilbart-cnn-12-6")
|
| 11 |
+
# visualqna = pipeline(task="vqa", model="microsoft/DialoGPT-medium")
|
| 12 |
+
visualqna = pipeline(model="dandelin/vilt-b32-finetuned-vqa")
|
| 13 |
|
| 14 |
|
| 15 |
def load_image():
|
| 16 |
with st.sidebar:
|
| 17 |
img = st.text_input("Enter Image URL")
|
| 18 |
if st.button("Load Image"):
|
| 19 |
+
st.write("Image Uploaded!")
|
| 20 |
+
# st.image(img)
|
| 21 |
return img
|
| 22 |
|
| 23 |
# def homepage():
|
|
|
|
| 81 |
def visual_qna():
|
| 82 |
st.title("Visual Q&A")
|
| 83 |
img = load_image()
|
| 84 |
+
st.image(img)
|
| 85 |
if img:
|
| 86 |
if query := st.chat_input("Enter your message"):
|
| 87 |
response = visualqna(question=query, image=img)
|