Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ from haystack.utils import convert_files_to_docs
|
|
| 6 |
from haystack.schema import Answer
|
| 7 |
from haystack.document_stores import InMemoryDocumentStore
|
| 8 |
from haystack.pipelines import ExtractiveQAPipeline
|
| 9 |
-
from haystack.nodes import FARMReader,
|
| 10 |
import logging
|
| 11 |
from markdown import markdown
|
| 12 |
from annotated_text import annotation
|
|
@@ -25,7 +25,7 @@ DEFAULT_ANSWER_AT_STARTUP = os.getenv("DEFAULT_ANSWER_AT_STARTUP", "Paris")
|
|
| 25 |
def place_header_center(text, lottie_data):
|
| 26 |
cgap1, ctitle, cgap2 = st.columns([3, 3, 1])
|
| 27 |
with cgap1:
|
| 28 |
-
st_lottie(lottie_data, height=
|
| 29 |
with ctitle:
|
| 30 |
st.title(text)
|
| 31 |
with cgap2:
|
|
@@ -52,7 +52,7 @@ def load_and_write_data(document_store):
|
|
| 52 |
# def start_haystack():
|
| 53 |
document_store = InMemoryDocumentStore() # use_bm25=True
|
| 54 |
load_and_write_data(document_store)
|
| 55 |
-
retriever =
|
| 56 |
reader = FARMReader(model_name_or_path="mrm8488/RuPERTa-base-finetuned-squadv1",
|
| 57 |
use_gpu=False,
|
| 58 |
num_processes=1)
|
|
|
|
| 6 |
from haystack.schema import Answer
|
| 7 |
from haystack.document_stores import InMemoryDocumentStore
|
| 8 |
from haystack.pipelines import ExtractiveQAPipeline
|
| 9 |
+
from haystack.nodes import FARMReader, TfidfRetriever
|
| 10 |
import logging
|
| 11 |
from markdown import markdown
|
| 12 |
from annotated_text import annotation
|
|
|
|
| 25 |
def place_header_center(text, lottie_data):
|
| 26 |
cgap1, ctitle, cgap2 = st.columns([3, 3, 1])
|
| 27 |
with cgap1:
|
| 28 |
+
st_lottie(lottie_data, height=250)
|
| 29 |
with ctitle:
|
| 30 |
st.title(text)
|
| 31 |
with cgap2:
|
|
|
|
| 52 |
# def start_haystack():
|
| 53 |
document_store = InMemoryDocumentStore() # use_bm25=True
|
| 54 |
load_and_write_data(document_store)
|
| 55 |
+
retriever = TfidfRetriever(document_store=document_store)
|
| 56 |
reader = FARMReader(model_name_or_path="mrm8488/RuPERTa-base-finetuned-squadv1",
|
| 57 |
use_gpu=False,
|
| 58 |
num_processes=1)
|