Omnibus commited on
Commit
cbe7532
1 Parent(s): e1995dc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -32,13 +32,12 @@ def format_prompt_default(message, history,cust_p):
32
  def format_prompt_gemma(message, history,cust_p):
33
  prompt = ""
34
  if history:
35
- #<start_of_turn>userHow does the brain work?<end_of_turn><start_of_turn>model
36
  for user_prompt, bot_response in history:
37
- prompt += f"{user_prompt}\n"
38
- print(prompt)
39
- prompt += f"{bot_response}\n"
40
- print(prompt)
41
- #prompt += f"<start_of_turn>user{message}<end_of_turn><start_of_turn>model"
42
  prompt+=cust_p.replace("USER_INPUT",message)
43
  return prompt
44
  def format_prompt_openc(message, history,cust_p):
@@ -68,7 +67,7 @@ def format_prompt_mixtral(message, history,cust_p):
68
  return prompt
69
 
70
  def format_prompt_choose(message, history, cust_p, model_name):
71
- if "gemma" in models[model_name].lower() and "it" in models[model_name].lower():
72
  return format_prompt_gemma(message,history,cust_p)
73
  if "mixtral" in models[model_name].lower():
74
  return format_prompt_mixtral(message,history,cust_p)
 
32
  def format_prompt_gemma(message, history,cust_p):
33
  prompt = ""
34
  if history:
 
35
  for user_prompt, bot_response in history:
36
+ prompt += f"<start_of_turn>user{user_prompt}<end_of_turn>"
37
+ prompt += f"<start_of_turn>model{bot_response}<end_of_turn>"
38
+ if VERBOSE==True:
39
+ print(prompt)
40
+ #prompt += f"<start_of_turn>user\n{message}<end_of_turn>\n<start_of_turn>model\n"
41
  prompt+=cust_p.replace("USER_INPUT",message)
42
  return prompt
43
  def format_prompt_openc(message, history,cust_p):
 
67
  return prompt
68
 
69
  def format_prompt_choose(message, history, cust_p, model_name):
70
+ if "gemma" in models[model_name].lower():
71
  return format_prompt_gemma(message,history,cust_p)
72
  if "mixtral" in models[model_name].lower():
73
  return format_prompt_mixtral(message,history,cust_p)