Spaces:
Sleeping
Sleeping
AFischer1985
commited on
Commit
•
da9d270
1
Parent(s):
39ea8d1
Update run.py
Browse files
run.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# Title: Gradio Interface to LLM-chatbot with RAG-funcionality and ChromaDB on HF-Hub
|
3 |
# Author: Andreas Fischer
|
4 |
# Date: December 29th, 2023
|
5 |
-
# Last update: December
|
6 |
##########################################################################################
|
7 |
|
8 |
|
@@ -94,7 +94,7 @@ def response(
|
|
94 |
#where={"source": "google-docs"}
|
95 |
#where_document={"$contains":"search_string"}
|
96 |
)
|
97 |
-
dists=["<small>(relevance: "+str(round((1-d)*100/100)
|
98 |
sources=["source: "+s["source"]+")</small>" for s in results['metadatas'][0]]
|
99 |
results=results['documents'][0]
|
100 |
combination = zip(results,dists,sources)
|
|
|
2 |
# Title: Gradio Interface to LLM-chatbot with RAG-funcionality and ChromaDB on HF-Hub
|
3 |
# Author: Andreas Fischer
|
4 |
# Date: December 29th, 2023
|
5 |
+
# Last update: December 30th, 2023
|
6 |
##########################################################################################
|
7 |
|
8 |
|
|
|
94 |
#where={"source": "google-docs"}
|
95 |
#where_document={"$contains":"search_string"}
|
96 |
)
|
97 |
+
dists=["<small>(relevance: "+str(round((1-d)*100)/100)+";" for d in results['distances'][0]]
|
98 |
sources=["source: "+s["source"]+")</small>" for s in results['metadatas'][0]]
|
99 |
results=results['documents'][0]
|
100 |
combination = zip(results,dists,sources)
|