prithivMLmods
commited on
Update app.py
Browse files
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"
|
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"
|
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"
|
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])}"
|