Spaces:
Runtime error
Runtime error
Minor changes and removing the settings
Browse files- pages/2_⚙️_Settings.py +0 -5
- utils/haystack.py +3 -3
pages/2_⚙️_Settings.py
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
from utils.frontend import build_sidebar
|
3 |
-
|
4 |
-
build_sidebar()
|
5 |
-
st.write("This is the settings page")
|
|
|
|
|
|
|
|
|
|
|
|
utils/haystack.py
CHANGED
@@ -40,7 +40,7 @@ def start_haystack():
|
|
40 |
faiss_index_path=f"{INDEX_DIR}/images.faiss",
|
41 |
faiss_config_path=f"{INDEX_DIR}/images.json",
|
42 |
)
|
43 |
-
|
44 |
retriever_text = EmbeddingRetriever(
|
45 |
document_store=document_store_text,
|
46 |
embedding_model="sentence-transformers/multi-qa-mpnet-base-dot-v1",
|
@@ -73,8 +73,8 @@ def start_haystack():
|
|
73 |
pipe = start_haystack()
|
74 |
|
75 |
@st.cache(allow_output_mutation=True)
|
76 |
-
def query(statement: str,
|
77 |
"""Run query"""
|
78 |
-
params = {"image_retriever": {"top_k":
|
79 |
results = pipe.run(statement, params=params)
|
80 |
return results
|
|
|
40 |
faiss_index_path=f"{INDEX_DIR}/images.faiss",
|
41 |
faiss_config_path=f"{INDEX_DIR}/images.json",
|
42 |
)
|
43 |
+
|
44 |
retriever_text = EmbeddingRetriever(
|
45 |
document_store=document_store_text,
|
46 |
embedding_model="sentence-transformers/multi-qa-mpnet-base-dot-v1",
|
|
|
73 |
pipe = start_haystack()
|
74 |
|
75 |
@st.cache(allow_output_mutation=True)
|
76 |
+
def query(statement: str, text_reader_top_k: int = 5):
|
77 |
"""Run query"""
|
78 |
+
params = {"text_reader": {"top_k": text_reader_top_k},"image_retriever": {"top_k": 1},"text_retriever": {"top_k": 5} }
|
79 |
results = pipe.run(statement, params=params)
|
80 |
return results
|