openfree commited on
Commit
b2d0728
·
verified ·
1 Parent(s): 5e50764

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -1010,11 +1010,15 @@ Use the "Generate" button for basic creation, "Enhance" button for prompt improv
1010
  )
1011
 
1012
 
 
 
 
 
 
 
1013
 
1014
-
1015
- # 버튼 이벤트 핸들러
1016
  btn.click(
1017
- fn=lambda q, s, m: execute_search_and_generate(q, s) if m else demo_instance.generation_code(q, s),
1018
  inputs=[input, setting, search_mode],
1019
  outputs=[code_output, sandbox, state_tab, code_drawer]
1020
  ).then(
@@ -1022,7 +1026,7 @@ Use the "Generate" button for basic creation, "Enhance" button for prompt improv
1022
  inputs=[],
1023
  outputs=[input]
1024
  )
1025
-
1026
 
1027
 
1028
  boost_btn.click(
 
1010
  )
1011
 
1012
 
1013
+ async def handle_generation(query, setting, is_search):
1014
+ if is_search:
1015
+ result = await execute_search_and_generate(query, setting)
1016
+ else:
1017
+ result = await demo_instance.generation_code(query, setting)
1018
+ return result
1019
 
 
 
1020
  btn.click(
1021
+ fn=handle_generation,
1022
  inputs=[input, setting, search_mode],
1023
  outputs=[code_output, sandbox, state_tab, code_drawer]
1024
  ).then(
 
1026
  inputs=[],
1027
  outputs=[input]
1028
  )
1029
+
1030
 
1031
 
1032
  boost_btn.click(