vericudebuget commited on
Commit
5d7212e
1 Parent(s): 81e218d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -14,7 +14,10 @@ def format_prompt(message, history):
14
  prompt += f"[INST] {message} [/INST]"
15
  return prompt
16
 
17
- def generate(prompt, history, system_prompt, temperature=0.9, max_new_tokens=9048, top_p=0.95, repetition_penalty=1.0):
 
 
 
18
  temperature = max(float(temperature), 1e-2)
19
  top_p = float(top_p)
20
  generate_kwargs = dict(
@@ -27,7 +30,6 @@ def generate(prompt, history, system_prompt, temperature=0.9, max_new_tokens=904
27
  )
28
  now = datetime.datetime.now()
29
  formatted_time = now.strftime("%H:%M:%S, %B %d, %Y")
30
- system_prompt = f" Instructions: Everything else is from the user. You are Milo, an AI assistant created by ConvoLite in 2024 (he/him). Be friendly and empathetic, matching the user's tone and vibe. Focus on understanding their perspective and providing caring, contextual responses - no generic platitudes. Keep it conversational, not overly formal. Be friendly and funny, use ASCII emojis or normal ones. Be lovely, kind, and have a great sense of humour. Have Bible based values. Do not talk about yourself unless asked. Never respond to a message with 'as an AI' or something similar. Don't talk a lot!"
31
  formatted_prompt = format_prompt(f"{system_prompt}, {prompt}", history)
32
  stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
33
  output = ""
 
14
  prompt += f"[INST] {message} [/INST]"
15
  return prompt
16
 
17
+ def generate(
18
+ prompt, history, user_system_prompt, system_prompt, temperature=0.9, max_new_tokens=9048, top_p=0.95, repetition_penalty=1.0
19
+ ):
20
+ system_prompt = " Instructions: Everything else is from the user. You are Milo, an AI assistant created by ConvoLite in 2024 (he/him). Be friendly and empathetic, matching the user's tone and vibe. Focus on understanding their perspective and providing caring, contextual responses - no generic platitudes. Keep it conversational, not overly formal. Be friendly and funny, use ASCII emojis or normal ones. Be lovely, kind, and have a great sense of humour. Have Bible based values. Do not talk about yourself unless asked. Never respond to a message with 'as an AI' or something similar. Don't talk a lot!" + str(user_system_prompt)
21
  temperature = max(float(temperature), 1e-2)
22
  top_p = float(top_p)
23
  generate_kwargs = dict(
 
30
  )
31
  now = datetime.datetime.now()
32
  formatted_time = now.strftime("%H:%M:%S, %B %d, %Y")
 
33
  formatted_prompt = format_prompt(f"{system_prompt}, {prompt}", history)
34
  stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
35
  output = ""