JBDef commited on
Commit
efa5069
1 Parent(s): 853c4f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -11
app.py CHANGED
@@ -1,14 +1,19 @@
1
- # -*- coding: utf-8 -*-
2
- """app.ipynb
3
-
4
- Automatically generated by Colaboratory.
5
-
6
- Original file is located at
7
- https://colab.research.google.com/drive/1bXYJd-Dtj9a5gFAvEQDojckzYpN0pcRX
8
- """
9
-
10
  from transformers import pipeline
11
 
12
- question = pipeline("visual-question-answering")
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
- question("cat.png", "how many cat are there?")
 
 
1
+ import streamlit as st
 
 
 
 
 
 
 
 
2
  from transformers import pipeline
3
 
4
+ qa = pipeline("question-answering" , model="JBDef/finetuned_yelp")
5
+ def main():
6
+ st.title("Question Answering")
7
+
8
+ with st.form("text_field"):
9
+ question = st.text_input("Enter some question :")
10
+ context = st.text_input("Enter some context :")
11
+
12
+ # clicked==True only when the button is clicked
13
+ clicked = st.form_submit_button("Submit")
14
+ if clicked:
15
+ results = qa(question , context)
16
+ st.json(results)
17
 
18
+ if __name__ == "__main__":
19
+ main()