Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -288,6 +288,10 @@ def chatbot_interface(message, history, use_web_search, model, temperature, num_
|
|
288 |
history = history + [(message, "")]
|
289 |
|
290 |
try:
|
|
|
|
|
|
|
|
|
291 |
for response in respond(message, history, model, temperature, num_calls, use_web_search):
|
292 |
history[-1] = (message, response)
|
293 |
yield history
|
@@ -325,8 +329,6 @@ def respond(message, history, model, temperature, num_calls, use_web_search, sel
|
|
325 |
if use_web_search:
|
326 |
for main_content, sources in get_response_with_search(message, model, num_calls=num_calls, temperature=temperature):
|
327 |
response = f"{main_content}\n\n{sources}"
|
328 |
-
first_line = response.split('\n')[0] if response else ''
|
329 |
-
# logging.info(f"Generated Response (first line): {first_line}")
|
330 |
yield response
|
331 |
else:
|
332 |
embed = get_embeddings()
|
|
|
288 |
history = history + [(message, "")]
|
289 |
|
290 |
try:
|
291 |
+
if use_web_search:
|
292 |
+
history[-1] = (message, "Generating response... (This may take a moment)")
|
293 |
+
yield history
|
294 |
+
|
295 |
for response in respond(message, history, model, temperature, num_calls, use_web_search):
|
296 |
history[-1] = (message, response)
|
297 |
yield history
|
|
|
329 |
if use_web_search:
|
330 |
for main_content, sources in get_response_with_search(message, model, num_calls=num_calls, temperature=temperature):
|
331 |
response = f"{main_content}\n\n{sources}"
|
|
|
|
|
332 |
yield response
|
333 |
else:
|
334 |
embed = get_embeddings()
|