Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -36,6 +36,7 @@ def question_answering(context, question):
|
|
36 |
# choose the source with different tabs
|
37 |
tab1, tab2 = st.tabs(["Input text", "Upload File"])
|
38 |
|
|
|
39 |
# if type the text as input
|
40 |
with tab1:
|
41 |
# set the example
|
@@ -67,11 +68,11 @@ with tab1:
|
|
67 |
else:
|
68 |
question_answering(context, question)
|
69 |
|
70 |
-
|
71 |
# if upload file as input
|
72 |
with tab2:
|
73 |
# provide upload place
|
74 |
-
uploaded_file = st.file_uploader("Choose a .
|
75 |
|
76 |
# transfer file to context and allow ask question, then perform question answering
|
77 |
if uploaded_file is not None:
|
|
|
36 |
# choose the source with different tabs
|
37 |
tab1, tab2 = st.tabs(["Input text", "Upload File"])
|
38 |
|
39 |
+
'''--- input text ---'''
|
40 |
# if type the text as input
|
41 |
with tab1:
|
42 |
# set the example
|
|
|
68 |
else:
|
69 |
question_answering(context, question)
|
70 |
|
71 |
+
'''--- upload file ---'''
|
72 |
# if upload file as input
|
73 |
with tab2:
|
74 |
# provide upload place
|
75 |
+
uploaded_file = st.file_uploader("Choose a .pdf file to upload", type=["pdf"])
|
76 |
|
77 |
# transfer file to context and allow ask question, then perform question answering
|
78 |
if uploaded_file is not None:
|