Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,19 @@
|
|
1 |
-
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
-
|
|
|
|
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()
|