Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -438,7 +438,6 @@ def get_random_placeholder():
|
|
| 438 |
def update_placeholder():
|
| 439 |
return gr.update(placeholder=get_random_placeholder())
|
| 440 |
|
| 441 |
-
|
| 442 |
def create_main_interface():
|
| 443 |
"""๋ฉ์ธ ์ธํฐํ์ด์ค ์์ฑ ํจ์"""
|
| 444 |
|
|
@@ -462,6 +461,7 @@ def create_main_interface():
|
|
| 462 |
custom_css = f.read()
|
| 463 |
|
| 464 |
demo = gr.Blocks(css=custom_css + """
|
|
|
|
| 465 |
.empty-content {
|
| 466 |
padding: 40px !important;
|
| 467 |
background: #f8f9fa !important;
|
|
@@ -567,13 +567,19 @@ def create_main_interface():
|
|
| 567 |
}
|
| 568 |
""", theme=theme)
|
| 569 |
|
|
|
|
|
|
|
| 570 |
with demo:
|
| 571 |
with gr.Tabs(elem_classes="main-tabs") as tabs:
|
| 572 |
with gr.Tab("Visual AI Assistant", elem_id="mouse-tab", elem_classes="mouse-tab"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 573 |
with ms.Application() as app:
|
| 574 |
with antd.ConfigProvider():
|
| 575 |
|
| 576 |
-
# Drawer ์ปดํฌ๋ํธ
|
| 577 |
with antd.Drawer(open=False, title="AI is Creating...", placement="left", width="750px") as code_drawer:
|
| 578 |
gr.HTML("""
|
| 579 |
<div class="thinking-container">
|
|
@@ -827,17 +833,17 @@ def create_main_interface():
|
|
| 827 |
sandbox = gr.HTML(elem_classes="html_content")
|
| 828 |
|
| 829 |
|
| 830 |
-
# ์ด๋ฒคํธ ํธ๋ค๋ฌ ์ฐ๊ฒฐ
|
| 831 |
btn.click(
|
| 832 |
demo_instance.generation_code,
|
| 833 |
-
inputs=[input, setting],
|
| 834 |
outputs=[code_output, sandbox, state_tab, code_drawer]
|
| 835 |
-
).then(
|
| 836 |
fn=update_placeholder,
|
| 837 |
inputs=[],
|
| 838 |
outputs=[input]
|
| 839 |
)
|
| 840 |
|
|
|
|
| 841 |
boost_btn.click(
|
| 842 |
fn=handle_boost,
|
| 843 |
inputs=[input],
|
|
|
|
| 438 |
def update_placeholder():
|
| 439 |
return gr.update(placeholder=get_random_placeholder())
|
| 440 |
|
|
|
|
| 441 |
def create_main_interface():
|
| 442 |
"""๋ฉ์ธ ์ธํฐํ์ด์ค ์์ฑ ํจ์"""
|
| 443 |
|
|
|
|
| 461 |
custom_css = f.read()
|
| 462 |
|
| 463 |
demo = gr.Blocks(css=custom_css + """
|
| 464 |
+
|
| 465 |
.empty-content {
|
| 466 |
padding: 40px !important;
|
| 467 |
background: #f8f9fa !important;
|
|
|
|
| 567 |
}
|
| 568 |
""", theme=theme)
|
| 569 |
|
| 570 |
+
|
| 571 |
+
|
| 572 |
with demo:
|
| 573 |
with gr.Tabs(elem_classes="main-tabs") as tabs:
|
| 574 |
with gr.Tab("Visual AI Assistant", elem_id="mouse-tab", elem_classes="mouse-tab"):
|
| 575 |
+
# SystemPrompt ์ค์ ์ ์ํ State ์ถ๊ฐ
|
| 576 |
+
setting = gr.State({
|
| 577 |
+
"system": SystemPrompt,
|
| 578 |
+
})
|
| 579 |
+
|
| 580 |
with ms.Application() as app:
|
| 581 |
with antd.ConfigProvider():
|
| 582 |
|
|
|
|
| 583 |
with antd.Drawer(open=False, title="AI is Creating...", placement="left", width="750px") as code_drawer:
|
| 584 |
gr.HTML("""
|
| 585 |
<div class="thinking-container">
|
|
|
|
| 833 |
sandbox = gr.HTML(elem_classes="html_content")
|
| 834 |
|
| 835 |
|
|
|
|
| 836 |
btn.click(
|
| 837 |
demo_instance.generation_code,
|
| 838 |
+
inputs=[input, setting], # setting์ด ์ด์ ์ ์๋จ
|
| 839 |
outputs=[code_output, sandbox, state_tab, code_drawer]
|
| 840 |
+
).then(
|
| 841 |
fn=update_placeholder,
|
| 842 |
inputs=[],
|
| 843 |
outputs=[input]
|
| 844 |
)
|
| 845 |
|
| 846 |
+
|
| 847 |
boost_btn.click(
|
| 848 |
fn=handle_boost,
|
| 849 |
inputs=[input],
|