prithivMLmods commited on
Commit
ea10a4f
·
verified ·
1 Parent(s): 1fc1a44

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -93,7 +93,7 @@ def respond(message, history):
93
  web_results = search(query)
94
  gr.Info("Extracting relevant Info")
95
  web2 = ' '.join([f"Link: {res['link']}\nText: {res['text']}\n\n" for res in web_results if res['text']])
96
- messages = f"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."
97
  for msg in history:
98
  messages += f"\nuser\n{str(msg[0])}"
99
  messages += f"\nassistant\n{str(msg[1])}"
@@ -105,7 +105,7 @@ def respond(message, history):
105
  output += response.token.text
106
  yield output
107
  else:
108
- messages = f"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."
109
  for msg in history:
110
  messages += f"\nuser\n{str(msg[0])}"
111
  messages += f"\nassistant\n{str(msg[1])}"
@@ -117,7 +117,7 @@ def respond(message, history):
117
  output += response.token.text
118
  yield output
119
  except:
120
- messages = f"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."
121
  for msg in history:
122
  messages += f"\nuser\n{str(msg[0])}"
123
  messages += f"\nassistant\n{str(msg[1])}"
 
93
  web_results = search(query)
94
  gr.Info("Extracting relevant Info")
95
  web2 = ' '.join([f"Link: {res['link']}\nText: {res['text']}\n\n" for res in web_results if res['text']])
96
+ messages = f""
97
  for msg in history:
98
  messages += f"\nuser\n{str(msg[0])}"
99
  messages += f"\nassistant\n{str(msg[1])}"
 
105
  output += response.token.text
106
  yield output
107
  else:
108
+ messages = f""
109
  for msg in history:
110
  messages += f"\nuser\n{str(msg[0])}"
111
  messages += f"\nassistant\n{str(msg[1])}"
 
117
  output += response.token.text
118
  yield output
119
  except:
120
+ messages = f""
121
  for msg in history:
122
  messages += f"\nuser\n{str(msg[0])}"
123
  messages += f"\nassistant\n{str(msg[1])}"