Spaces:
Sleeping
Sleeping
AFischer1985
commited on
Commit
•
0083c1a
1
Parent(s):
da9d270
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 |
|
@@ -67,9 +67,9 @@ import json
|
|
67 |
|
68 |
def format_prompt(message, history):
|
69 |
prompt = "<s>"
|
70 |
-
for user_prompt, bot_response in history:
|
71 |
-
|
72 |
-
|
73 |
prompt += f"[INST] {message} [/INST]"
|
74 |
return prompt
|
75 |
|
@@ -113,5 +113,5 @@ def response(
|
|
113 |
output=output+"\n\n<br><details open><summary><strong>Sources</strong></summary><br><ul>"+ "".join(["<li>" + s + "</li>" for s in combination])+"</ul></details>"
|
114 |
yield output
|
115 |
|
116 |
-
gr.ChatInterface(response, chatbot=gr.Chatbot(render_markdown=True),title="RAG-Interface to the Hugging Face Hub").queue().launch(share=True) #False, server_name="0.0.0.0", server_port=7864)
|
117 |
print("Interface up and running!")
|
|
|
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 31th, 2023
|
6 |
##########################################################################################
|
7 |
|
8 |
|
|
|
67 |
|
68 |
def format_prompt(message, history):
|
69 |
prompt = "<s>"
|
70 |
+
#for user_prompt, bot_response in history:
|
71 |
+
# prompt += f"[INST] {user_prompt} [/INST]"
|
72 |
+
# prompt += f" {bot_response}</s> "
|
73 |
prompt += f"[INST] {message} [/INST]"
|
74 |
return prompt
|
75 |
|
|
|
113 |
output=output+"\n\n<br><details open><summary><strong>Sources</strong></summary><br><ul>"+ "".join(["<li>" + s + "</li>" for s in combination])+"</ul></details>"
|
114 |
yield output
|
115 |
|
116 |
+
gr.ChatInterface(response, chatbot=gr.Chatbot(render_markdown=True),title="German RAG-Interface to the Hugging Face Hub").queue().launch(share=True) #False, server_name="0.0.0.0", server_port=7864)
|
117 |
print("Interface up and running!")
|