openfree commited on
Commit
c0042d0
·
verified ·
1 Parent(s): f101e49

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -18
app.py CHANGED
@@ -567,8 +567,6 @@ def update_placeholder():
567
  return gr.update(placeholder=get_random_placeholder())
568
 
569
 
570
-
571
-
572
  def create_main_interface():
573
  """메인 인터페이스 생성 함수"""
574
 
@@ -653,23 +651,23 @@ The response should be in HTML format with appropriate styling."""
653
  gr.update(active_key="error"),
654
  gr.update(open=False)
655
  ]
656
-
657
- def execute_code(query: str):
658
- if not query or query.strip() == '':
659
- return None, gr.update(active_key="empty")
660
-
661
- try:
662
- if '```html' in query and '```' in query:
663
- code = remove_code_block(query)
664
- else:
665
- code = query.strip()
666
-
667
- return send_to_sandbox(code), gr.update(active_key="render")
668
- except Exception as e:
669
- print(f"Error executing code: {str(e)}")
670
- return None, gr.update(active_key="empty")
671
 
672
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
673
 
674
 
675
  async def handle_generation(query, setting, is_search):
 
567
  return gr.update(placeholder=get_random_placeholder())
568
 
569
 
 
 
570
  def create_main_interface():
571
  """메인 인터페이스 생성 함수"""
572
 
 
651
  gr.update(active_key="error"),
652
  gr.update(open=False)
653
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
654
 
655
+ def execute_code(query: str):
656
+ if not query or query.strip() == '':
657
+ return None, gr.update(active_key="empty")
658
+
659
+ try:
660
+ if '```html' in query and '```' in query:
661
+ code = remove_code_block(query)
662
+ else:
663
+ code = query.strip()
664
+
665
+ return send_to_sandbox(code), gr.update(active_key="render")
666
+ except Exception as e:
667
+ print(f"Error executing code: {str(e)}")
668
+ return None, gr.update(active_key="empty")
669
+
670
+
671
 
672
 
673
  async def handle_generation(query, setting, is_search):