Spaces:
Sleeping
Sleeping
Stefano Fiorucci
commited on
Commit
•
b5d59e3
1
Parent(s):
f79a364
bug fix
Browse files
app.py
CHANGED
@@ -57,7 +57,7 @@ def set_state_if_absent(key, value):
|
|
57 |
|
58 |
# hash_funcs={builtins.weakref: my_hash_func}
|
59 |
@st.cache(persist=True, allow_output_mutation=True)
|
60 |
-
def query(question, retriever_top_k=10, reader_top_k=5)
|
61 |
"""Run query and get answers"""
|
62 |
params = {"Retriever": {"top_k": retriever_top_k},
|
63 |
"Reader": {"top_k": reader_top_k}}
|
@@ -191,7 +191,7 @@ and see if the AI can find an answer...
|
|
191 |
|
192 |
):
|
193 |
try:
|
194 |
-
st.session_state.results = query(
|
195 |
time_end=time.time()
|
196 |
print(f'elapsed time: {time_end - time_start}')
|
197 |
except JSONDecodeError as je:
|
|
|
57 |
|
58 |
# hash_funcs={builtins.weakref: my_hash_func}
|
59 |
@st.cache(persist=True, allow_output_mutation=True)
|
60 |
+
def query(question: str, retriever_top_k:int=10, reader_top_k:int=5):
|
61 |
"""Run query and get answers"""
|
62 |
params = {"Retriever": {"top_k": retriever_top_k},
|
63 |
"Reader": {"top_k": reader_top_k}}
|
|
|
191 |
|
192 |
):
|
193 |
try:
|
194 |
+
st.session_state.results = query(question)
|
195 |
time_end=time.time()
|
196 |
print(f'elapsed time: {time_end - time_start}')
|
197 |
except JSONDecodeError as je:
|