Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import dill
|
2 |
import streamlit as st
|
3 |
import os
|
4 |
-
from haystack.utils import
|
5 |
from haystack.schema import Answer
|
6 |
from haystack.document_stores import InMemoryDocumentStore
|
7 |
from haystack.pipelines import ExtractiveQAPipeline
|
@@ -15,7 +15,7 @@ st.set_page_config(page_title="QA-project", page_icon="📇")
|
|
15 |
os.environ['TOKENIZERS_PARALLELISM'] = "false"
|
16 |
DATA_DIR = './dataset'
|
17 |
DOCS_PATH = os.path.join(DATA_DIR, 'all_docs_36838.pkl')
|
18 |
-
LOTTIE_PATH = 'img/108423-search-for-documents.json'
|
19 |
PROG_TITLE = "QA project Demo"
|
20 |
# Adjust to a question that you would like users to see in the search bar when they load the UI:
|
21 |
DEFAULT_QUESTION_AT_STARTUP = os.getenv("DEFAULT_QUESTION_AT_STARTUP", "What's the capital of France?")
|
@@ -49,7 +49,7 @@ def load_and_write_data(document_store):
|
|
49 |
# Haystack Components
|
50 |
# @st.cache(allow_output_mutation=True)
|
51 |
# def start_haystack():
|
52 |
-
document_store = InMemoryDocumentStore(use_bm25=True
|
53 |
load_and_write_data(document_store)
|
54 |
retriever = BM25Retriever(document_store=document_store)
|
55 |
reader = FARMReader(model_name_or_path="mrm8488/RuPERTa-base-finetuned-squadv1",
|
|
|
1 |
import dill
|
2 |
import streamlit as st
|
3 |
import os
|
4 |
+
from haystack.utils import convert_files_to_docs
|
5 |
from haystack.schema import Answer
|
6 |
from haystack.document_stores import InMemoryDocumentStore
|
7 |
from haystack.pipelines import ExtractiveQAPipeline
|
|
|
15 |
os.environ['TOKENIZERS_PARALLELISM'] = "false"
|
16 |
DATA_DIR = './dataset'
|
17 |
DOCS_PATH = os.path.join(DATA_DIR, 'all_docs_36838.pkl')
|
18 |
+
LOTTIE_PATH = './img/108423-search-for-documents.json'
|
19 |
PROG_TITLE = "QA project Demo"
|
20 |
# Adjust to a question that you would like users to see in the search bar when they load the UI:
|
21 |
DEFAULT_QUESTION_AT_STARTUP = os.getenv("DEFAULT_QUESTION_AT_STARTUP", "What's the capital of France?")
|
|
|
49 |
# Haystack Components
|
50 |
# @st.cache(allow_output_mutation=True)
|
51 |
# def start_haystack():
|
52 |
+
document_store = InMemoryDocumentStore() # use_bm25=True
|
53 |
load_and_write_data(document_store)
|
54 |
retriever = BM25Retriever(document_store=document_store)
|
55 |
reader = FARMReader(model_name_or_path="mrm8488/RuPERTa-base-finetuned-squadv1",
|