Spaces:
Runtime error
Runtime error
Update run.py
Browse files
run.py
CHANGED
@@ -152,21 +152,21 @@ else:
|
|
152 |
def extend_prompt(message="", history=None, system=None, RAGAddon=None, system2=None, zeichenlimit=None,historylimit=4): #float("Inf")
|
153 |
if zeichenlimit is None: zeichenlimit=1000000000 # :-)
|
154 |
#https://huggingface.co/docs/transformers/main/chat_templating
|
155 |
-
template0="[INST] {system} [/INST]Gerne.</s> " # <s> einleitend wird ergänzt, Leerzeichen um Input und nach </s>
|
156 |
-
template1="[INST] {message} [/INST]"
|
157 |
-
template2="{response}</s> "
|
158 |
if("discolm_german_7b" in modelPath): #https://huggingface.co/DiscoResearch/DiscoLM_German_7b_v1
|
159 |
template0="<|im_start|>system\n{system}<|im_end|>\n"
|
160 |
template1="<|im_start|>user\n{message}<|im_end|>\n<|im_start|>assistant\n"
|
161 |
template2="{response}<|im_end|>\n"
|
162 |
if("mixtral-8x7b-instruct" in modelPath): # https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1
|
163 |
-
template0="[INST] {system} [/INST]Gerne.</s> " # <s>
|
164 |
-
template1="[INST] {message} [/INST]"
|
165 |
-
template2="{response}</s> "
|
166 |
if("Mistral-7B-Instruct" in modelPath): #https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2
|
167 |
-
template0="[INST] {system} [/INST]Gerne.</s> " # <s>
|
168 |
-
template1="[INST] {message} [/INST]"
|
169 |
-
template2="{response}</s> "
|
170 |
if("gemma-" in modelPath): # https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1
|
171 |
template0="<start_of_turn>user{system}</end_of_turn>"
|
172 |
template1="<start_of_turn>user{message}</end_of_turn><start_of_turn>model"
|
|
|
152 |
def extend_prompt(message="", history=None, system=None, RAGAddon=None, system2=None, zeichenlimit=None,historylimit=4): #float("Inf")
|
153 |
if zeichenlimit is None: zeichenlimit=1000000000 # :-)
|
154 |
#https://huggingface.co/docs/transformers/main/chat_templating
|
155 |
+
template0="[INST] {system} [/INST] Gerne.</s> " # Variante: Antworten unmittelbar. <s> einleitend wird ergänzt, Leerzeichen um Input und nach </s>
|
156 |
+
template1="[INST] {message} [/INST]" # Leerzeichen um Input, keines nach [/INST]
|
157 |
+
template2=" {response}</s> " # Variante: Antworten folgen unmittelbar, enden ohne Leerzeichen vor </s>
|
158 |
if("discolm_german_7b" in modelPath): #https://huggingface.co/DiscoResearch/DiscoLM_German_7b_v1
|
159 |
template0="<|im_start|>system\n{system}<|im_end|>\n"
|
160 |
template1="<|im_start|>user\n{message}<|im_end|>\n<|im_start|>assistant\n"
|
161 |
template2="{response}<|im_end|>\n"
|
162 |
if("mixtral-8x7b-instruct" in modelPath): # https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1
|
163 |
+
template0="[INST] {system} [/INST] Gerne.</s> " # <s>
|
164 |
+
template1="[INST] {message} [/INST]"
|
165 |
+
template2="{response}</s> "
|
166 |
if("Mistral-7B-Instruct" in modelPath): #https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2
|
167 |
+
template0="[INST] {system} [/INST] Gerne.</s> " # <s>
|
168 |
+
template1="[INST] {message} [/INST]"
|
169 |
+
template2=" {response}</s> "
|
170 |
if("gemma-" in modelPath): # https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1
|
171 |
template0="<start_of_turn>user{system}</end_of_turn>"
|
172 |
template1="<start_of_turn>user{message}</end_of_turn><start_of_turn>model"
|