Spaces:
Runtime error
Runtime error
Update appStore/multiapp.py
Browse files- appStore/multiapp.py +11 -0
appStore/multiapp.py
CHANGED
|
@@ -16,6 +16,17 @@ logger = logging.getLogger(__name__)
|
|
| 16 |
if 'file' not in st.session_state:
|
| 17 |
st.session_state['pipeline'] = None
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
class MultiApp:
|
| 20 |
"""
|
| 21 |
Framework for combining multiple streamlit applications.
|
|
|
|
| 16 |
if 'file' not in st.session_state:
|
| 17 |
st.session_state['pipeline'] = None
|
| 18 |
|
| 19 |
+
#Haystack Components
|
| 20 |
+
@st.cache(hash_funcs={"builtins.SwigPyObject": lambda _: None},allow_output_mutation=True)
|
| 21 |
+
|
| 22 |
+
def start_haystack(documents_processed):
|
| 23 |
+
document_store = InMemoryDocumentStore()
|
| 24 |
+
document_store.write_documents(documents_processed)
|
| 25 |
+
retriever = TfidfRetriever(document_store=document_store)
|
| 26 |
+
reader = FARMReader(model_name_or_path="deepset/tinyroberta-squad2", use_gpu=True) #deepset/roberta-base-squad2
|
| 27 |
+
pipeline = ExtractiveQAPipeline(reader, retriever)
|
| 28 |
+
return pipeline
|
| 29 |
+
|
| 30 |
class MultiApp:
|
| 31 |
"""
|
| 32 |
Framework for combining multiple streamlit applications.
|