Update app.py
Browse files
app.py
CHANGED
|
@@ -507,8 +507,8 @@ def respond(message, history, model, temperature, num_calls, use_web_search, sel
|
|
| 507 |
# Process Excel documents
|
| 508 |
if excel_docs:
|
| 509 |
if model == "gemini-1.5-flash":
|
| 510 |
-
|
| 511 |
-
|
| 512 |
else:
|
| 513 |
for response in get_response_from_excel(message, model, excel_context, num_calls, temperature):
|
| 514 |
yield response
|
|
@@ -516,8 +516,8 @@ def respond(message, history, model, temperature, num_calls, use_web_search, sel
|
|
| 516 |
# Process other documents (PDF, Word)
|
| 517 |
if other_docs:
|
| 518 |
if model == "gemini-1.5-flash":
|
| 519 |
-
|
| 520 |
-
|
| 521 |
elif model == "@cf/meta/llama-3.1-8b-instruct":
|
| 522 |
for response in get_response_from_cloudflare(prompt="", context=other_context, query=message, num_calls=num_calls, temperature=temperature, search_type="document"):
|
| 523 |
yield response
|
|
|
|
| 507 |
# Process Excel documents
|
| 508 |
if excel_docs:
|
| 509 |
if model == "gemini-1.5-flash":
|
| 510 |
+
for chunk in get_response_from_gemini(message, excel_context, "excel", num_calls, temperature):
|
| 511 |
+
yield chunk
|
| 512 |
else:
|
| 513 |
for response in get_response_from_excel(message, model, excel_context, num_calls, temperature):
|
| 514 |
yield response
|
|
|
|
| 516 |
# Process other documents (PDF, Word)
|
| 517 |
if other_docs:
|
| 518 |
if model == "gemini-1.5-flash":
|
| 519 |
+
for chunk in get_response_from_gemini(message, other_context, "pdf", num_calls, temperature):
|
| 520 |
+
yield chunk
|
| 521 |
elif model == "@cf/meta/llama-3.1-8b-instruct":
|
| 522 |
for response in get_response_from_cloudflare(prompt="", context=other_context, query=message, num_calls=num_calls, temperature=temperature, search_type="document"):
|
| 523 |
yield response
|