openfree commited on
Commit
4ef85b1
ยท
verified ยท
1 Parent(s): aaacf0e

Update mouse.py

Browse files
Files changed (1) hide show
  1. mouse.py +9 -5
mouse.py CHANGED
@@ -22,6 +22,7 @@ import string
22
  import random
23
  import requests # ์ƒ๋‹จ import ๊ตฌ๋ฌธ์— ์ถ”๊ฐ€
24
 
 
25
 
26
  # SystemPrompt ๋ถ€๋ถ„์„ ์ง์ ‘ ์ •์˜
27
  SystemPrompt = """๋„ˆ์˜ ์ด๋ฆ„์€ 'MOUSE'์ด๋‹ค. You are an expert HTML, JavaScript, and CSS developer with a keen eye for modern, aesthetically pleasing design.
@@ -901,12 +902,15 @@ def handle_boost(prompt: str):
901
  print(f"Boost ์ฒ˜๋ฆฌ ์ค‘ ์˜ค๋ฅ˜: {str(e)}")
902
  return prompt, gr.update(active_key="empty")
903
 
904
-
905
- # Demo ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ
906
- demo_instance = Demo()
907
 
 
 
908
 
 
909
  with gr.Blocks(css_paths="app.css",theme=theme) as demo:
 
 
 
910
  history = gr.State([])
911
  setting = gr.State({
912
  "system": SystemPrompt,
@@ -1109,11 +1113,11 @@ with gr.Blocks(css_paths="app.css",theme=theme) as demo:
1109
  )
1110
 
1111
 
1112
-
1113
  if __name__ == "__main__":
1114
  try:
1115
  demo_instance = Demo()
1116
- demo.queue(default_concurrency_limit=20).launch(ssr_mode=False)
1117
  except Exception as e:
1118
  print(f"Initialization error: {e}")
1119
  raise
 
22
  import random
23
  import requests # ์ƒ๋‹จ import ๊ตฌ๋ฌธ์— ์ถ”๊ฐ€
24
 
25
+ __all__ = ['Demo', 'demo', 'SystemPrompt', 'mouse_interface', 'history_to_messages', 'messages_to_history']
26
 
27
  # SystemPrompt ๋ถ€๋ถ„์„ ์ง์ ‘ ์ •์˜
28
  SystemPrompt = """๋„ˆ์˜ ์ด๋ฆ„์€ 'MOUSE'์ด๋‹ค. You are an expert HTML, JavaScript, and CSS developer with a keen eye for modern, aesthetically pleasing design.
 
902
  print(f"Boost ์ฒ˜๋ฆฌ ์ค‘ ์˜ค๋ฅ˜: {str(e)}")
903
  return prompt, gr.update(active_key="empty")
904
 
 
 
 
905
 
906
+ # ํŒŒ์ผ ์ƒ๋‹จ์— ํ•œ ๋ฒˆ๋งŒ ์„ ์–ธ
907
+ mouse_interface = None
908
 
909
+ # with gr.Blocks ๋ถ€๋ถ„์—์„œ ์„ค์ •
910
  with gr.Blocks(css_paths="app.css",theme=theme) as demo:
911
+ global mouse_interface
912
+ mouse_interface = demo
913
+
914
  history = gr.State([])
915
  setting = gr.State({
916
  "system": SystemPrompt,
 
1113
  )
1114
 
1115
 
1116
+ # mouse.py ํŒŒ์ผ ๋งจ ์•„๋ž˜์˜ ์‹คํ–‰ ๋ถ€๋ถ„์„ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ˆ˜์ •
1117
  if __name__ == "__main__":
1118
  try:
1119
  demo_instance = Demo()
1120
+ demo.queue(default_concurrency_limit=20) # .launch() ๋ถ€๋ถ„๋งŒ ์ œ๊ฑฐ
1121
  except Exception as e:
1122
  print(f"Initialization error: {e}")
1123
  raise