Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -669,21 +669,20 @@ The response should be in HTML format with appropriate styling."""
|
|
| 669 |
|
| 670 |
|
| 671 |
|
| 672 |
-
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
|
| 679 |
-
|
| 680 |
-
|
| 681 |
-
|
| 682 |
-
final_result
|
| 683 |
-
|
| 684 |
-
|
| 685 |
-
|
| 686 |
-
return ["", None, gr.update(active_key="error"), gr.update(open=False)]
|
| 687 |
|
| 688 |
# CSS ํ์ผ ๋ด์ฉ์ ์ง์ ์ ์ฉ
|
| 689 |
with open('app.css', 'r', encoding='utf-8') as f:
|
|
|
|
| 669 |
|
| 670 |
|
| 671 |
|
| 672 |
+
async def handle_generation(query, setting, is_search):
|
| 673 |
+
try:
|
| 674 |
+
print(f"Mode: {'Web Search' if is_search else 'Generate'}") # ๋๋ฒ๊น
์ฉ
|
| 675 |
+
if is_search:
|
| 676 |
+
print("Executing search and generate...") # ๋๋ฒ๊น
์ฉ
|
| 677 |
+
return await execute_search_and_generate(query, setting)
|
| 678 |
+
else:
|
| 679 |
+
print("Executing normal generation...") # ๋๋ฒ๊น
์ฉ
|
| 680 |
+
async for result in demo_instance.generation_code(query, setting):
|
| 681 |
+
final_result = result
|
| 682 |
+
return final_result
|
| 683 |
+
except Exception as e:
|
| 684 |
+
print(f"Generation error: {str(e)}")
|
| 685 |
+
return ["", None, gr.update(active_key="error"), gr.update(open=False)]
|
|
|
|
| 686 |
|
| 687 |
# CSS ํ์ผ ๋ด์ฉ์ ์ง์ ์ ์ฉ
|
| 688 |
with open('app.css', 'r', encoding='utf-8') as f:
|