Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -565,19 +565,6 @@ def update_placeholder():
|
|
565 |
return gr.update(placeholder=get_random_placeholder())
|
566 |
|
567 |
|
568 |
-
async def handle_generation(query, setting, is_search):
|
569 |
-
try:
|
570 |
-
if is_search:
|
571 |
-
# 중복된 코드 제거
|
572 |
-
return await execute_search_and_generate(query, setting)
|
573 |
-
else:
|
574 |
-
async for result in demo_instance.generation_code(query, setting):
|
575 |
-
final_result = result
|
576 |
-
return final_result
|
577 |
-
except Exception as e:
|
578 |
-
print(f"Generation error: {str(e)}")
|
579 |
-
return ["", None, gr.update(active_key="error"), gr.update(open=False)]
|
580 |
-
|
581 |
|
582 |
def create_main_interface():
|
583 |
"""메인 인터페이스 생성 함수"""
|
@@ -635,6 +622,7 @@ def create_main_interface():
|
|
635 |
final_result = result
|
636 |
return final_result
|
637 |
|
|
|
638 |
except Exception as e:
|
639 |
print(f"Search error: {str(e)}")
|
640 |
return [
|
@@ -644,8 +632,18 @@ def create_main_interface():
|
|
644 |
gr.update(open=False)
|
645 |
]
|
646 |
|
647 |
-
|
648 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
649 |
def execute_code(query: str):
|
650 |
if not query or query.strip() == '':
|
651 |
return None, gr.update(active_key="empty")
|
|
|
565 |
return gr.update(placeholder=get_random_placeholder())
|
566 |
|
567 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
568 |
|
569 |
def create_main_interface():
|
570 |
"""메인 인터페이스 생성 함수"""
|
|
|
622 |
final_result = result
|
623 |
return final_result
|
624 |
|
625 |
+
|
626 |
except Exception as e:
|
627 |
print(f"Search error: {str(e)}")
|
628 |
return [
|
|
|
632 |
gr.update(open=False)
|
633 |
]
|
634 |
|
635 |
+
async def handle_generation(query, setting, is_search):
|
636 |
+
try:
|
637 |
+
if is_search:
|
638 |
+
return await execute_search_and_generate(query, setting)
|
639 |
+
else:
|
640 |
+
async for result in demo_instance.generation_code(query, setting):
|
641 |
+
final_result = result
|
642 |
+
return final_result
|
643 |
+
except Exception as e:
|
644 |
+
print(f"Generation error: {str(e)}")
|
645 |
+
return ["", None, gr.update(active_key="error"), gr.update(open=False)]
|
646 |
+
|
647 |
def execute_code(query: str):
|
648 |
if not query or query.strip() == '':
|
649 |
return None, gr.update(active_key="empty")
|