Spaces:
Running
Running
Update mouse.py
Browse files
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(
|
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
|