Spaces:
Runtime error
Runtime error
gorkemgoknar
commited on
Commit
•
e94c8fe
1
Parent(s):
43356c3
Update app.py
Browse files
app.py
CHANGED
@@ -187,7 +187,7 @@ def format_prompt_mistral(message, history, system_message=system_message,system
|
|
187 |
|
188 |
def format_prompt_yi(message, history, system_message=system_message,system_understand_message=system_understand_message):
|
189 |
prompt = (
|
190 |
-
"<s>[INST]
|
191 |
)
|
192 |
for user_prompt, bot_response in history:
|
193 |
prompt += f"[INST] {user_prompt} [/INST]"
|
@@ -265,7 +265,7 @@ def generate_local(
|
|
265 |
sys_system_understand_message = system_understand_message.replace("##LLM_MODEL###",llm_model).replace("##LLM_MODEL_PROVIDER###",llm_provider)
|
266 |
|
267 |
if "yi" in llm_model.lower():
|
268 |
-
formatted_prompt =
|
269 |
else:
|
270 |
formatted_prompt = format_prompt_mistral(prompt, history,system_message=sys_message,system_understand_message=sys_system_understand_message)
|
271 |
|
|
|
187 |
|
188 |
def format_prompt_yi(message, history, system_message=system_message,system_understand_message=system_understand_message):
|
189 |
prompt = (
|
190 |
+
"<s>[INST] [SYS]\n" + system_message + "\n[/SYS]\n\n[/INST]"
|
191 |
)
|
192 |
for user_prompt, bot_response in history:
|
193 |
prompt += f"[INST] {user_prompt} [/INST]"
|
|
|
265 |
sys_system_understand_message = system_understand_message.replace("##LLM_MODEL###",llm_model).replace("##LLM_MODEL_PROVIDER###",llm_provider)
|
266 |
|
267 |
if "yi" in llm_model.lower():
|
268 |
+
formatted_prompt = format_prompt_mistral(prompt, history,system_message=sys_message,system_understand_message="")
|
269 |
else:
|
270 |
formatted_prompt = format_prompt_mistral(prompt, history,system_message=sys_message,system_understand_message=sys_system_understand_message)
|
271 |
|