openfree commited on
Commit
f3a0670
ยท
verified ยท
1 Parent(s): 89f0877

Update mouse.py

Browse files
Files changed (1) hide show
  1. mouse.py +13 -9
mouse.py CHANGED
@@ -904,15 +904,18 @@ def handle_boost(prompt: str):
904
 
905
  # ํŒŒ์ผ ์ƒ๋‹จ์—์„œ ์ „์—ญ ๋ณ€์ˆ˜ ์„ ์–ธ
906
  mouse_interface = None
 
 
907
 
908
  with gr.Blocks(css_paths="app.css",theme=theme) as demo:
909
- # global ํ‚ค์›Œ๋“œ ์ œ๊ฑฐ (์ด๋ฏธ ์ƒ๋‹จ์—์„œ ์„ ์–ธํ–ˆ์œผ๋ฏ€๋กœ)
910
  mouse_interface = demo
911
-
912
  history = gr.State([])
913
  setting = gr.State({
914
  "system": SystemPrompt,
915
  })
 
 
916
 
917
 
918
  with ms.Application() as app:
@@ -1078,13 +1081,16 @@ with gr.Blocks(css_paths="app.css",theme=theme) as demo:
1078
  lambda: (gr.update(open=False), gr.HTML("")),
1079
  outputs=[session_drawer, session_history]
1080
  )
1081
-
 
1082
  btn.click(
1083
- demo_instance.generation_code,
1084
  inputs=[input, setting, history],
1085
  outputs=[code_output, history, sandbox, state_tab, code_drawer]
1086
  )
1087
 
 
 
1088
  clear_btn.click(
1089
  demo_instance.clear_history,
1090
  inputs=[],
@@ -1108,12 +1114,10 @@ with gr.Blocks(css_paths="app.css",theme=theme) as demo:
1108
  )
1109
 
1110
 
1111
- # mouse.py ํŒŒ์ผ ๋งจ ์•„๋ž˜์˜ ์‹คํ–‰ ๋ถ€๋ถ„์„ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ˆ˜์ •
1112
  if __name__ == "__main__":
1113
  try:
1114
- demo_instance = Demo()
1115
- demo.queue(default_concurrency_limit=20) # .launch() ๋ถ€๋ถ„๋งŒ ์ œ๊ฑฐ
1116
  except Exception as e:
1117
  print(f"Initialization error: {e}")
1118
- raise
1119
-
 
904
 
905
  # ํŒŒ์ผ ์ƒ๋‹จ์—์„œ ์ „์—ญ ๋ณ€์ˆ˜ ์„ ์–ธ
906
  mouse_interface = None
907
+ demo = None
908
+ demo_instance = Demo() # Demo ์ธ์Šคํ„ด์Šค๋ฅผ ๋จผ์ € ์ƒ์„ฑ
909
 
910
  with gr.Blocks(css_paths="app.css",theme=theme) as demo:
 
911
  mouse_interface = demo
912
+
913
  history = gr.State([])
914
  setting = gr.State({
915
  "system": SystemPrompt,
916
  })
917
+
918
+
919
 
920
 
921
  with ms.Application() as app:
 
1081
  lambda: (gr.update(open=False), gr.HTML("")),
1082
  outputs=[session_drawer, session_history]
1083
  )
1084
+
1085
+ # ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ๋“ค
1086
  btn.click(
1087
+ demo_instance.generation_code, # ์ด์ œ demo_instance๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Œ
1088
  inputs=[input, setting, history],
1089
  outputs=[code_output, history, sandbox, state_tab, code_drawer]
1090
  )
1091
 
1092
+
1093
+
1094
  clear_btn.click(
1095
  demo_instance.clear_history,
1096
  inputs=[],
 
1114
  )
1115
 
1116
 
1117
+ # ํŒŒ์ผ ๋งจ ์•„๋ž˜์˜ ์‹คํ–‰ ๋ถ€๋ถ„
1118
  if __name__ == "__main__":
1119
  try:
1120
+ demo.queue(default_concurrency_limit=20)
 
1121
  except Exception as e:
1122
  print(f"Initialization error: {e}")
1123
+ raise