Spaces:
Runtime error
Runtime error
Update run.py
Browse files
run.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# Title: Gradio Interface to LLM-chatbot with memory RAG on premises
|
3 |
# Author: Andreas Fischer
|
4 |
# Date: October 15th, 2023
|
5 |
-
# Last update: February
|
6 |
##########################################################################################
|
7 |
|
8 |
#https://github.com/abetlen/llama-cpp-python/issues/306
|
@@ -170,6 +170,7 @@ def extend_prompt(message="", history=None, system=None, RAGAddon=None, system2=
|
|
170 |
template1="[INST] {message} [/INST]"
|
171 |
template2=" {response}</s>"
|
172 |
if("openchat-3.5" in modelPath): #https://huggingface.co/TheBloke/openchat-3.5-0106-GGUF
|
|
|
173 |
template0="GPT4 Correct User: {system}<|end_of_turn|>GPT4 Correct Assistant: Okay.<|end_of_turn|>"
|
174 |
template1="GPT4 Correct User: {message}<|end_of_turn|>GPT4 Correct Assistant: "
|
175 |
template2="{response}<|end_of_turn|>"
|
@@ -234,9 +235,9 @@ def response(message, history,customSysPrompt,settings):
|
|
234 |
rag += "Mit Blick auf den aktuellen Stand der Session erinnerst du dich insb. an folgende Episode:\n"
|
235 |
rag += bestMatch
|
236 |
rag += "\n\nIm Folgenden siehst du den aktuellen Stand der Session."
|
237 |
-
rag += "Bitte beschreibe kurz den weiteren Verlauf bis zur nächsten Handlung des Spielers!"
|
238 |
else:
|
239 |
-
system += "\nBitte beschreibe kurz den weiteren Verlauf bis zur nächsten Handlung des Spielers!"
|
240 |
system2=None # system2 can be used as fictive first words of the AI, which are not displayed or stored
|
241 |
#print("RAG: "+rag)
|
242 |
#print("System: "+system+"\n\nMessage: "+message)
|
|
|
2 |
# Title: Gradio Interface to LLM-chatbot with memory RAG on premises
|
3 |
# Author: Andreas Fischer
|
4 |
# Date: October 15th, 2023
|
5 |
+
# Last update: February 25st, 2024
|
6 |
##########################################################################################
|
7 |
|
8 |
#https://github.com/abetlen/llama-cpp-python/issues/306
|
|
|
170 |
template1="[INST] {message} [/INST]"
|
171 |
template2=" {response}</s>"
|
172 |
if("openchat-3.5" in modelPath): #https://huggingface.co/TheBloke/openchat-3.5-0106-GGUF
|
173 |
+
startOfString="<s>
|
174 |
template0="GPT4 Correct User: {system}<|end_of_turn|>GPT4 Correct Assistant: Okay.<|end_of_turn|>"
|
175 |
template1="GPT4 Correct User: {message}<|end_of_turn|>GPT4 Correct Assistant: "
|
176 |
template2="{response}<|end_of_turn|>"
|
|
|
235 |
rag += "Mit Blick auf den aktuellen Stand der Session erinnerst du dich insb. an folgende Episode:\n"
|
236 |
rag += bestMatch
|
237 |
rag += "\n\nIm Folgenden siehst du den aktuellen Stand der Session."
|
238 |
+
if (noAdditions==False): rag += "Bitte beschreibe kurz den weiteren Verlauf bis zur nächsten Handlung des Spielers!"
|
239 |
else:
|
240 |
+
if (noAdditions==False): system += "\nBitte beschreibe kurz den weiteren Verlauf bis zur nächsten Handlung des Spielers!"
|
241 |
system2=None # system2 can be used as fictive first words of the AI, which are not displayed or stored
|
242 |
#print("RAG: "+rag)
|
243 |
#print("System: "+system+"\n\nMessage: "+message)
|