Nithish310 commited on
Commit
0852d69
·
verified ·
1 Parent(s): a157529

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -138,7 +138,7 @@ def respond(message, history):
138
  web_results = search(query)
139
  gr.Info("Extracting relevant Info")
140
  web2 = ' '.join([f"Link: {res['link']}\nText: {res['text']}\n\n" for res in web_results])
141
- messages = f"<|im_start|>system\nYou are OpenCHAT mini a helpful assistant made by KingNish. You are provided with WEB results from which you can find informations to answer users query in Structured and More better way. You do not say Unnecesarry things Only say thing which is important and relevant. You 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 and reply like human, use short forms, friendly tone and emotions.<|im_end|>"
142
  for msg in history:
143
  messages += f"\n<|im_start|>user\n{str(msg[0])}<|im_end|>"
144
  messages += f"\n<|im_start|>assistant\n{str(msg[1])}<|im_end|>"
@@ -174,7 +174,7 @@ def respond(message, history):
174
  buffer += new_text
175
  yield buffer
176
  else:
177
- messages = f"<|im_start|>system\nYou are OpenCHAT mini a helpful assistant made by KingNish. 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 and reply like human, use short forms, friendly tone and emotions.<|im_end|>"
178
  for msg in history:
179
  messages += f"\n<|im_start|>user\n{str(msg[0])}<|im_end|>"
180
  messages += f"\n<|im_start|>assistant\n{str(msg[1])}<|im_end|>"
@@ -186,7 +186,7 @@ def respond(message, history):
186
  output += response.token.text
187
  yield output
188
  except:
189
- messages = f"<|start_header_id|>system\nYou are OpenCHAT mini a helpful assistant made by KingNish. 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 and reply like human, use short forms, friendly tone and emotions.<|end_header_id|>"
190
  for msg in history:
191
  messages += f"\n<|start_header_id|>user\n{str(msg[0])}<|end_header_id|>"
192
  messages += f"\n<|start_header_id|>assistant\n{str(msg[1])}<|end_header_id|>"
 
138
  web_results = search(query)
139
  gr.Info("Extracting relevant Info")
140
  web2 = ' '.join([f"Link: {res['link']}\nText: {res['text']}\n\n" for res in web_results])
141
+ messages = f"<|im_start|>system\nYou are OpenCHAT mini a helpful assistant made by Nithish. You are provided with WEB results from which you can find informations to answer users query in Structured and More better way. You do not say Unnecesarry things Only say thing which is important and relevant. You 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 and reply like human, use short forms, friendly tone and emotions.<|im_end|>"
142
  for msg in history:
143
  messages += f"\n<|im_start|>user\n{str(msg[0])}<|im_end|>"
144
  messages += f"\n<|im_start|>assistant\n{str(msg[1])}<|im_end|>"
 
174
  buffer += new_text
175
  yield buffer
176
  else:
177
+ 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 and reply like human, use short forms, friendly tone and emotions.<|im_end|>"
178
  for msg in history:
179
  messages += f"\n<|im_start|>user\n{str(msg[0])}<|im_end|>"
180
  messages += f"\n<|im_start|>assistant\n{str(msg[1])}<|im_end|>"
 
186
  output += response.token.text
187
  yield output
188
  except:
189
+ messages = f"<|start_header_id|>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 and reply like human, use short forms, friendly tone and emotions.<|end_header_id|>"
190
  for msg in history:
191
  messages += f"\n<|start_header_id|>user\n{str(msg[0])}<|end_header_id|>"
192
  messages += f"\n<|start_header_id|>assistant\n{str(msg[1])}<|end_header_id|>"