awinml commited on
Commit
368d5ea
1 Parent(s): c5f41e6

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
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={"year": year, "quarter": quarter, "ticker": ticker},
 
 
 
 
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}")