Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -143,7 +143,7 @@ with gr.Blocks(css_paths="app.css") as demo:
|
|
| 143 |
except Exception as e:
|
| 144 |
raise ValueError(f'Error calling Claude API: {str(e)}')
|
| 145 |
|
| 146 |
-
|
| 147 |
with antd.ConfigProvider():
|
| 148 |
# ๋ฉ์ธ ์ปจํ
์ธ ์์ญ
|
| 149 |
with antd.Row(gutter=[32, 12], elem_classes="main-content") as layout:
|
|
@@ -169,11 +169,9 @@ with gr.Blocks(css_paths="app.css") as demo:
|
|
| 169 |
with antd.Col(span=24, md=16):
|
| 170 |
# Setting ๋ฒํผ๋ค์ ์ฐ์ธก ์๋จ์ ๋ณ๋๋ก ๋ฐฐ์น
|
| 171 |
with antd.Row(justify="end", elem_classes="setting-buttons-row"):
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
codeBtn = antd.Button("๐งโ๐ป view code", type="default")
|
| 176 |
-
historyBtn = antd.Button("๐ history", type="default")
|
| 177 |
|
| 178 |
# ์น ์ถ๋ ฅ ํจ๋
|
| 179 |
with ms.Div(elem_classes="right_panel"):
|
|
@@ -184,8 +182,48 @@ with gr.Blocks(css_paths="app.css") as demo:
|
|
| 184 |
with antd.Tabs.Item(key="loading"):
|
| 185 |
loading = antd.Spin(True, tip="coding...", size="large", elem_classes="right_content")
|
| 186 |
with antd.Tabs.Item(key="render"):
|
| 187 |
-
sandbox = gr.HTML(elem_classes="html_content")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 189 |
# Examples ์น์
|
| 190 |
with antd.Row(elem_classes="examples-section"):
|
| 191 |
with antd.Col(span=24):
|
|
@@ -233,5 +271,10 @@ with gr.Blocks(css_paths="app.css") as demo:
|
|
| 233 |
|
| 234 |
clear_btn.click(clear_history, inputs=[], outputs=[history])
|
| 235 |
|
|
|
|
| 236 |
if __name__ == "__main__":
|
| 237 |
-
demo.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
except Exception as e:
|
| 144 |
raise ValueError(f'Error calling Claude API: {str(e)}')
|
| 145 |
|
| 146 |
+
with ms.Application() as app:
|
| 147 |
with antd.ConfigProvider():
|
| 148 |
# ๋ฉ์ธ ์ปจํ
์ธ ์์ญ
|
| 149 |
with antd.Row(gutter=[32, 12], elem_classes="main-content") as layout:
|
|
|
|
| 169 |
with antd.Col(span=24, md=16):
|
| 170 |
# Setting ๋ฒํผ๋ค์ ์ฐ์ธก ์๋จ์ ๋ณ๋๋ก ๋ฐฐ์น
|
| 171 |
with antd.Row(justify="end", elem_classes="setting-buttons-row"):
|
| 172 |
+
settingPromptBtn = antd.Button("โ๏ธ set system Prompt", type="default")
|
| 173 |
+
codeBtn = antd.Button("๐งโ๐ป view code", type="default")
|
| 174 |
+
historyBtn = antd.Button("๐ history", type="default")
|
|
|
|
|
|
|
| 175 |
|
| 176 |
# ์น ์ถ๋ ฅ ํจ๋
|
| 177 |
with ms.Div(elem_classes="right_panel"):
|
|
|
|
| 182 |
with antd.Tabs.Item(key="loading"):
|
| 183 |
loading = antd.Spin(True, tip="coding...", size="large", elem_classes="right_content")
|
| 184 |
with antd.Tabs.Item(key="render"):
|
| 185 |
+
sandbox = gr.HTML(elem_classes="html_content")with ms.Application() as app:
|
| 186 |
+
|
| 187 |
+
with antd.ConfigProvider():
|
| 188 |
+
# ๋ฉ์ธ ์ปจํ
์ธ ์์ญ
|
| 189 |
+
with antd.Row(gutter=[32, 12], elem_classes="main-content") as layout:
|
| 190 |
+
# ์ข์ธก ํจ๋
|
| 191 |
+
with antd.Col(span=24, md=8):
|
| 192 |
+
with antd.Flex(vertical=True, gap="middle", wrap=True):
|
| 193 |
+
header = gr.HTML(f"""
|
| 194 |
+
<div class="left_header">
|
| 195 |
+
<img src="data:image/gif;base64,{get_image_base64('mouse.gif')}" width="360px" />
|
| 196 |
+
<h1 style="font-size: 20px;">AI ์ฝ๋ฉ ์ฝํ์ผ๋ฟ: MOUSE(WEB)</h2>
|
| 197 |
+
</div>
|
| 198 |
+
""")
|
| 199 |
+
input = antd.InputTextarea(
|
| 200 |
+
size="large",
|
| 201 |
+
allow_clear=True,
|
| 202 |
+
placeholder="Please enter what kind of application you want"
|
| 203 |
+
)
|
| 204 |
+
|
| 205 |
+
btn = antd.Button("send", type="primary", size="large")
|
| 206 |
+
clear_btn = antd.Button("clear history", type="default", size="large")
|
| 207 |
|
| 208 |
+
# ์ฐ์ธก ํจ๋
|
| 209 |
+
with antd.Col(span=24, md=16):
|
| 210 |
+
# Setting ๋ฒํผ๋ค์ ์ฐ์ธก ์๋จ์ ๋ณ๋๋ก ๋ฐฐ์น
|
| 211 |
+
with antd.Row(justify="end", elem_classes="setting-buttons-row"):
|
| 212 |
+
settingPromptBtn = antd.Button("โ๏ธ set system Prompt", type="default")
|
| 213 |
+
codeBtn = antd.Button("๐งโ๐ป view code", type="default")
|
| 214 |
+
historyBtn = antd.Button("๐ history", type="default")
|
| 215 |
+
|
| 216 |
+
# ์น ์ถ๋ ฅ ํจ๋
|
| 217 |
+
with ms.Div(elem_classes="right_panel"):
|
| 218 |
+
gr.HTML('<div class="render_header"><span class="header_btn"></span><span class="header_btn"></span><span class="header_btn"></span></div>')
|
| 219 |
+
with antd.Tabs(active_key="empty", render_tab_bar="() => null") as state_tab:
|
| 220 |
+
with antd.Tabs.Item(key="empty"):
|
| 221 |
+
empty = antd.Empty(description="empty input", elem_classes="right_content")
|
| 222 |
+
with antd.Tabs.Item(key="loading"):
|
| 223 |
+
loading = antd.Spin(True, tip="coding...", size="large", elem_classes="right_content")
|
| 224 |
+
with antd.Tabs.Item(key="render"):
|
| 225 |
+
sandbox = gr.HTML(elem_classes="html_content")
|
| 226 |
+
|
| 227 |
# Examples ์น์
|
| 228 |
with antd.Row(elem_classes="examples-section"):
|
| 229 |
with antd.Col(span=24):
|
|
|
|
| 271 |
|
| 272 |
clear_btn.click(clear_history, inputs=[], outputs=[history])
|
| 273 |
|
| 274 |
+
|
| 275 |
if __name__ == "__main__":
|
| 276 |
+
demo.launch(server_name="0.0.0.0",
|
| 277 |
+
server_port=7860,
|
| 278 |
+
share=False,
|
| 279 |
+
show_error=True,
|
| 280 |
+
ssr_mode=False)
|