Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
question = pipeline("visual-question-answering"
|
5 |
def main():
|
6 |
st.title("Visual Question Answering")
|
7 |
|
8 |
-
with st.form("
|
9 |
file = st.file_uploader("Upload image", type=["jpg", "png"])
|
10 |
text = st.text_area('enter some question:')
|
11 |
# clicked==True only when the button is clicked
|
12 |
clicked = st.form_submit_button("Submit")
|
13 |
if clicked:
|
14 |
-
results = question(
|
15 |
st.json(results)
|
16 |
|
17 |
if __name__ == "__main__":
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
question = pipeline("visual-question-answering")
|
5 |
def main():
|
6 |
st.title("Visual Question Answering")
|
7 |
|
8 |
+
with st.form("text_field"):
|
9 |
file = st.file_uploader("Upload image", type=["jpg", "png"])
|
10 |
text = st.text_area('enter some question:')
|
11 |
# clicked==True only when the button is clicked
|
12 |
clicked = st.form_submit_button("Submit")
|
13 |
if clicked:
|
14 |
+
results = question(file , text)
|
15 |
st.json(results)
|
16 |
|
17 |
if __name__ == "__main__":
|