mtyrrell commited on
Commit
78d3b40
1 Parent(s): fd6fc06

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -93,19 +93,19 @@ def get_refs(res):
93
  doc = res['documents'][i].to_dict()
94
  ref_id = doc['meta']['ref_id']
95
  if ref_id in ref_ids:
96
- result_str += "Ref. " + str(ref_id) + " [" + doc['meta']['country'] + " " + doc['meta']['document_name'] + "]: " + "'" + doc['content'] + "' " # Two spaces at the end
97
  return result_str
98
 
99
  def run_query(input_text):
100
  docs = get_docs(input_text)
101
- st.write('Debug: country', country) # Debugging country
102
  res = pipe.run(query=input_text, documents=docs)
103
  output = res["results"][0]
104
  st.write('Response')
105
  st.success(output)
106
  references = get_refs(res)
107
  st.write('References')
108
- st.markdown(references)
109
 
110
  # def run_query(input_text):
111
  # docs = get_docs(input_text)
 
93
  doc = res['documents'][i].to_dict()
94
  ref_id = doc['meta']['ref_id']
95
  if ref_id in ref_ids:
96
+ result_str += "Ref. " + str(ref_id) + " [" + doc['meta']['country'] + " " + doc['meta']['document_name'] + "]: " + "'" + doc['content'] + "'<br> <br>" # Add <br> for a line break
97
  return result_str
98
 
99
  def run_query(input_text):
100
  docs = get_docs(input_text)
101
+ st.write('Selected country: ', country) # Debugging country
102
  res = pipe.run(query=input_text, documents=docs)
103
  output = res["results"][0]
104
  st.write('Response')
105
  st.success(output)
106
  references = get_refs(res)
107
  st.write('References')
108
+ st.success(references)
109
 
110
  # def run_query(input_text):
111
  # docs = get_docs(input_text)