Spaces:
Build error
Build error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -66,7 +66,11 @@ def query_pinecone(query, top_k, model, index, year, quarter, ticker, threshold=
|
|
| 66 |
xc = index.query(
|
| 67 |
xq,
|
| 68 |
top_k=top_k,
|
| 69 |
-
filter={
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
include_metadata=True,
|
| 71 |
)
|
| 72 |
# filter the context passages based on the score threshold
|
|
@@ -272,8 +276,6 @@ elif decoder_model == "FLAN-T5":
|
|
| 272 |
show_retrieved_text = st.checkbox("Show Retrieved Text", value=False)
|
| 273 |
|
| 274 |
if show_retrieved_text:
|
| 275 |
-
|
| 276 |
st.subheader("Retrieved Text:")
|
| 277 |
-
|
| 278 |
for context_text in context_list:
|
| 279 |
st.markdown(f"- {context_text}")
|
|
|
|
| 66 |
xc = index.query(
|
| 67 |
xq,
|
| 68 |
top_k=top_k,
|
| 69 |
+
filter={
|
| 70 |
+
"Year": int(year),
|
| 71 |
+
"Quarter": {"$eq": quarter},
|
| 72 |
+
"Ticker": {"$eq": ticker},
|
| 73 |
+
},
|
| 74 |
include_metadata=True,
|
| 75 |
)
|
| 76 |
# filter the context passages based on the score threshold
|
|
|
|
| 276 |
show_retrieved_text = st.checkbox("Show Retrieved Text", value=False)
|
| 277 |
|
| 278 |
if show_retrieved_text:
|
|
|
|
| 279 |
st.subheader("Retrieved Text:")
|
|
|
|
| 280 |
for context_text in context_list:
|
| 281 |
st.markdown(f"- {context_text}")
|