Shreyas094
commited on
Commit
•
fcbb7d1
1
Parent(s):
c89450b
Update app.py
Browse files
app.py
CHANGED
@@ -324,7 +324,7 @@ def respond(message, history, model, temperature, num_calls, use_web_search, sel
|
|
324 |
for main_content, sources in get_response_with_search(message, model, num_calls=num_calls, temperature=temperature):
|
325 |
response = f"{main_content}\n\n{sources}"
|
326 |
first_line = response.split('\n')[0] if response else ''
|
327 |
-
logging.info(f"Generated Response (first line): {first_line}")
|
328 |
yield response
|
329 |
else:
|
330 |
embed = get_embeddings()
|
@@ -350,13 +350,13 @@ def respond(message, history, model, temperature, num_calls, use_web_search, sel
|
|
350 |
# Use Cloudflare API
|
351 |
for partial_response in get_response_from_cloudflare(prompt="", context=context_str, query=message, num_calls=num_calls, temperature=temperature, search_type="pdf"):
|
352 |
first_line = partial_response.split('\n')[0] if partial_response else ''
|
353 |
-
logging.info(f"Generated Response (first line): {first_line}")
|
354 |
yield partial_response
|
355 |
else:
|
356 |
# Use Hugging Face API
|
357 |
for partial_response in get_response_from_pdf(message, model, selected_docs, num_calls=num_calls, temperature=temperature):
|
358 |
first_line = partial_response.split('\n')[0] if partial_response else ''
|
359 |
-
logging.info(f"Generated Response (first line): {first_line}")
|
360 |
yield partial_response
|
361 |
|
362 |
except Exception as e:
|
|
|
324 |
for main_content, sources in get_response_with_search(message, model, num_calls=num_calls, temperature=temperature):
|
325 |
response = f"{main_content}\n\n{sources}"
|
326 |
first_line = response.split('\n')[0] if response else ''
|
327 |
+
# logging.info(f"Generated Response (first line): {first_line}")
|
328 |
yield response
|
329 |
else:
|
330 |
embed = get_embeddings()
|
|
|
350 |
# Use Cloudflare API
|
351 |
for partial_response in get_response_from_cloudflare(prompt="", context=context_str, query=message, num_calls=num_calls, temperature=temperature, search_type="pdf"):
|
352 |
first_line = partial_response.split('\n')[0] if partial_response else ''
|
353 |
+
# logging.info(f"Generated Response (first line): {first_line}")
|
354 |
yield partial_response
|
355 |
else:
|
356 |
# Use Hugging Face API
|
357 |
for partial_response in get_response_from_pdf(message, model, selected_docs, num_calls=num_calls, temperature=temperature):
|
358 |
first_line = partial_response.split('\n')[0] if partial_response else ''
|
359 |
+
# logging.info(f"Generated Response (first line): {first_line}")
|
360 |
yield partial_response
|
361 |
|
362 |
except Exception as e:
|