MilanM commited on
Commit
3adb1e8
·
verified ·
1 Parent(s): d595e9f

Update app_v2.py

Browse files
Files changed (1) hide show
  1. app_v2.py +5 -3
app_v2.py CHANGED
@@ -67,7 +67,7 @@ def setup_client():
67
  def prepare_prompt(prompt, chat_history):
68
  if genparam.TYPE == "chat" and chat_history:
69
  chats = "\n".join([f"{message['role']}: \"{message['content']}\"" for message in chat_history])
70
- return f"Conversation History:\n{chats}\n\n New User Prompt: {prompt}"
71
  return prompt
72
 
73
  def apply_prompt_syntax(prompt, system_prompt, prompt_template, bake_in_prompt_syntax):
@@ -85,8 +85,10 @@ def apply_prompt_syntax(prompt, system_prompt, prompt_template, bake_in_prompt_s
85
  "granite_code - with system": """System:\n{system_prompt}\n\nQuestion:\n{prompt}\n\nAnswer:\n""",
86
  "granite_code - instruction only": """Question:\n{prompt}\n\nAnswer:\n""",
87
  ### Mistral Models
88
- "mistral_large - sys": """[INST] {system_prompt}\n\n{prompt}[/INST]""", ### mistral-large-2407
89
- "mistral_large - user": """[INST] {prompt}[/INST]""", ### mistral-large-2407
 
 
90
 
91
  "mistral_large_2411 - sys": """[SYSTEM_PROMPT] {system_prompt}[/SYSTEM_PROMPT][INST] {prompt}[/INST]""", ### Only deploy on demand on watsonx.ai
92
 
 
67
  def prepare_prompt(prompt, chat_history):
68
  if genparam.TYPE == "chat" and chat_history:
69
  chats = "\n".join([f"{message['role']}: \"{message['content']}\"" for message in chat_history])
70
+ return f"Conversation History:\n{chats}\n\nNew User Input: {prompt}"
71
  return prompt
72
 
73
  def apply_prompt_syntax(prompt, system_prompt, prompt_template, bake_in_prompt_syntax):
 
85
  "granite_code - with system": """System:\n{system_prompt}\n\nQuestion:\n{prompt}\n\nAnswer:\n""",
86
  "granite_code - instruction only": """Question:\n{prompt}\n\nAnswer:\n""",
87
  ### Mistral Models
88
+ "mistral_large - sys": """[INST] {system_prompt}\n\nUser Input:{prompt}[/INST]""", ### mistral-large-2407
89
+
90
+ "mistral_large - sys base": """[INST] {system_prompt}\n\n{prompt}[/INST]""", ### mistral-large-2407
91
+ "mistral_large - user": """[INST] {prompt}[/INST]""", ### mistral-large-2407
92
 
93
  "mistral_large_2411 - sys": """[SYSTEM_PROMPT] {system_prompt}[/SYSTEM_PROMPT][INST] {prompt}[/INST]""", ### Only deploy on demand on watsonx.ai
94