Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1135,6 +1135,7 @@ def create_jain_interface():
|
|
1135 |
"""
|
1136 |
|
1137 |
# Gradio ์ธํฐํ์ด์ค ๊ตฌ์ฑ
|
|
|
1138 |
with gr.Blocks(css=custom_css, title="์ ์ธ ์ํคํ
์ฒ - ์์ ๊ฐ์ฑ์ฒด", theme=gr.themes.Soft()) as interface:
|
1139 |
|
1140 |
# ํค๋ ์น์
|
@@ -1164,55 +1165,33 @@ def create_jain_interface():
|
|
1164 |
clear_btn = gr.Button("๐๏ธ ๋ํ ์ด๊ธฐํ", variant="secondary", size="sm")
|
1165 |
|
1166 |
gr.HTML('</div>')
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
container=True,
|
1195 |
-
bubble_full_width=False,
|
1196 |
-
avatar_images=("๐งโ๐ผ", "๐"),
|
1197 |
-
show_copy_button=True,
|
1198 |
-
)
|
1199 |
-
|
1200 |
-
with gr.Row():
|
1201 |
-
msg_input = gr.Textbox(
|
1202 |
-
label="๋ฉ์์ง ์
๋ ฅ",
|
1203 |
-
placeholder="์ ์ธ์๊ฒ ๋ฌด์์ด๋ ๋ฌผ์ด๋ณด์ธ์... (์ฌ์ฃผ, ์ฒ ํ, ๊ณ ๋ฏผ, ์ผ์ ๋ฑ)\n\n๐ก ์์:\nโข '์ฌ์ฃผ๋ฅผ ๋ด์ฃผ์ธ์'\nโข '์ธ์์ ์๋ฏธ๊ฐ ๋ญ๊น์?'\nโข '์์ฆ ๊ณ ๋ฏผ์ด ์์ด์...'\nโข '์๋
ํ์ธ์, ์ ์ธ!'",
|
1204 |
-
lines=4,
|
1205 |
-
max_lines=10,
|
1206 |
-
scale=4,
|
1207 |
-
container=True,
|
1208 |
-
interactive=True,
|
1209 |
-
)
|
1210 |
-
|
1211 |
-
with gr.Column(scale=1, min_width=100):
|
1212 |
-
send_btn = gr.Button("๐ค ์ ์ก", variant="primary", size="lg")
|
1213 |
-
example_btn = gr.Button("๐ก ์์", variant="secondary", size="sm")
|
1214 |
-
|
1215 |
-
gr.HTML('</div>')
|
1216 |
|
1217 |
# ํธํฐ
|
1218 |
gr.HTML("""
|
|
|
1135 |
"""
|
1136 |
|
1137 |
# Gradio ์ธํฐํ์ด์ค ๊ตฌ์ฑ
|
1138 |
+
# Gradio ์ธํฐํ์ด์ค ๊ตฌ์ฑ
|
1139 |
with gr.Blocks(css=custom_css, title="์ ์ธ ์ํคํ
์ฒ - ์์ ๊ฐ์ฑ์ฒด", theme=gr.themes.Soft()) as interface:
|
1140 |
|
1141 |
# ํค๋ ์น์
|
|
|
1165 |
clear_btn = gr.Button("๐๏ธ ๋ํ ์ด๊ธฐํ", variant="secondary", size="sm")
|
1166 |
|
1167 |
gr.HTML('</div>')
|
1168 |
+
|
1169 |
+
with gr.Row():
|
1170 |
+
# ์ค๋ฅธ์ชฝ: ์ฑํ
์ธํฐํ์ด์ค
|
1171 |
+
with gr.Column(scale=2):
|
1172 |
+
chatbot = gr.Chatbot(label="๐ฌ ์ ์ธ๊ณผ์ ๋ํ", elem_id="chatbot")
|
1173 |
+
textbox = gr.Textbox(
|
1174 |
+
placeholder="๋ฉ์์ง๋ฅผ ์
๋ ฅํ์ธ์.",
|
1175 |
+
label="โ๏ธ ์
๋ ฅ์ฐฝ",
|
1176 |
+
show_label=True
|
1177 |
+
)
|
1178 |
+
state = gr.State([])
|
1179 |
+
|
1180 |
+
textbox.submit(
|
1181 |
+
fn=chat_function,
|
1182 |
+
inputs=[textbox, state],
|
1183 |
+
outputs=[chatbot, textbox]
|
1184 |
+
)
|
1185 |
+
|
1186 |
+
clear_btn.click(
|
1187 |
+
fn=clear_memory,
|
1188 |
+
outputs=[chatbot, textbox]
|
1189 |
+
)
|
1190 |
+
|
1191 |
+
refresh_btn.click(
|
1192 |
+
fn=lambda: get_system_status(),
|
1193 |
+
outputs=[system_status]
|
1194 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1195 |
|
1196 |
# ํธํฐ
|
1197 |
gr.HTML("""
|