Spaces:
Runtime error
Runtime error
Update appStore/keyword_search.py
Browse files
appStore/keyword_search.py
CHANGED
@@ -32,7 +32,7 @@ def start_haystack(documents_processed):
|
|
32 |
document_store = InMemoryDocumentStore()
|
33 |
document_store.write_documents(documents_processed)
|
34 |
retriever = TfidfRetriever(document_store=document_store)
|
35 |
-
reader = FARMReader(model_name_or_path="
|
36 |
pipeline = ExtractiveQAPipeline(reader, retriever)
|
37 |
return pipeline
|
38 |
|
@@ -81,6 +81,7 @@ def app():
|
|
81 |
value="What particular risks does climate change pose for women?",)
|
82 |
if st.button("Find them."):
|
83 |
#file = st.file_uploader('Upload PDF File', type=['pdf', 'docx', 'txt'])
|
|
|
84 |
if file is not None:
|
85 |
with tempfile.NamedTemporaryFile(mode="wb") as temp:
|
86 |
bytes_data = file.getvalue()
|
@@ -121,5 +122,8 @@ def app():
|
|
121 |
except Exception as e:
|
122 |
logging.exception(e)
|
123 |
|
|
|
|
|
|
|
124 |
|
125 |
|
|
|
32 |
document_store = InMemoryDocumentStore()
|
33 |
document_store.write_documents(documents_processed)
|
34 |
retriever = TfidfRetriever(document_store=document_store)
|
35 |
+
reader = FARMReader(model_name_or_path="deepset/tinyroberta-squad2", use_gpu=True) #deepset/roberta-base-squad2
|
36 |
pipeline = ExtractiveQAPipeline(reader, retriever)
|
37 |
return pipeline
|
38 |
|
|
|
81 |
value="What particular risks does climate change pose for women?",)
|
82 |
if st.button("Find them."):
|
83 |
#file = st.file_uploader('Upload PDF File', type=['pdf', 'docx', 'txt'])
|
84 |
+
|
85 |
if file is not None:
|
86 |
with tempfile.NamedTemporaryFile(mode="wb") as temp:
|
87 |
bytes_data = file.getvalue()
|
|
|
122 |
except Exception as e:
|
123 |
logging.exception(e)
|
124 |
|
125 |
+
else:
|
126 |
+
st.info("🤔 No document found, please try to upload it at the sidebar!"
|
127 |
+
)
|
128 |
|
129 |
|