Nithish310 commited on
Commit
9bb6f16
·
verified ·
1 Parent(s): 4fa6c8a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -200,9 +200,9 @@ def respond(message, history):
200
  else:
201
  messages = f"<|im_start|>system\nYou are OpenCHAT mini a helpful assistant made by Nithish. You answers users query like human friend. You are also Expert in every field and also learn and try to answer from contexts related to previous question. Try your best to give best response possible to user. You also try to show emotions using Emojis only in required case and reply like human, use short forms, friendly tone and emotions.<|im_end|>"
202
  for msg in history:
203
- messages += f"\nuser\n{str(msg[0])}"
204
- messages += f"\nassistant\n{str(msg[1])}"
205
- messages += f"\nuser\n{message_text}\nassistant\n"
206
  stream = client_yi.text_generation(messages, max_new_tokens=2000, do_sample=True, stream=True,
207
  details=True, return_full_text=False)
208
  output = ""
 
200
  else:
201
  messages = f"<|im_start|>system\nYou are OpenCHAT mini a helpful assistant made by Nithish. You answers users query like human friend. You are also Expert in every field and also learn and try to answer from contexts related to previous question. Try your best to give best response possible to user. You also try to show emotions using Emojis only in required case and reply like human, use short forms, friendly tone and emotions.<|im_end|>"
202
  for msg in history:
203
+ messages += f"\n<|im_start|>user\n{str(msg[0])}<|im_end|>"
204
+ messages += f"\n<|im_start|>assistant\n{str(msg[1])}<|im_end|>"
205
+ messages += f"\n<|im_start|>user\n{message_text}<|im_end|>\n<|im_start|>assistant\n"
206
  stream = client_yi.text_generation(messages, max_new_tokens=2000, do_sample=True, stream=True,
207
  details=True, return_full_text=False)
208
  output = ""