AFischer1985 commited on
Commit
480902c
·
1 Parent(s): 04f37d5

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +2 -2
run.py CHANGED
@@ -93,7 +93,7 @@ def response(message, history):
93
  #where={"source": "google-docs"}
94
  #where_document={"$contains":"search_string"}
95
  )
96
- dists=["<small>(relevance: "+str(round(d*100)/100)+";" for d in results['distances'][0]]
97
  sources=["source: "+s["source"]+")</small>" for s in results['metadatas'][0]]
98
  results=results['documents'][0]
99
  combination = zip(results,dists,sources)
@@ -136,5 +136,5 @@ def response(message, history):
136
  yield response
137
  yield response+"\n\n<br><details open><summary><strong>Sources</strong></summary><br><ul>"+ "".join(["<li>" + s + "</li>" for s in combination])+"</ul></details>"
138
 
139
- gr.ChatInterface(response, chatbot=gr.Chatbot(render_markdown=True)).queue().launch(share=True) #False, server_name="0.0.0.0", server_port=7864)
140
  print("Interface up and running!")
 
93
  #where={"source": "google-docs"}
94
  #where_document={"$contains":"search_string"}
95
  )
96
+ dists=["<small>(relevance: "+str(round(1-d)*100)/100)+";" for d in results['distances'][0]]
97
  sources=["source: "+s["source"]+")</small>" for s in results['metadatas'][0]]
98
  results=results['documents'][0]
99
  combination = zip(results,dists,sources)
 
136
  yield response
137
  yield response+"\n\n<br><details open><summary><strong>Sources</strong></summary><br><ul>"+ "".join(["<li>" + s + "</li>" for s in combination])+"</ul></details>"
138
 
139
+ gr.ChatInterface(response, chatbot=gr.Chatbot(render_markdown=True),title="RAG-Interface").queue().launch(share=True) #False, server_name="0.0.0.0", server_port=7864)
140
  print("Interface up and running!")