Kim Juwon
commited on
Commit
Β·
4b1f53c
1
Parent(s):
86e2ae0
update UI/UX
Browse files
app.py
CHANGED
@@ -65,20 +65,16 @@ def respond(
|
|
65 |
def reset_chat():
|
66 |
return None
|
67 |
|
68 |
-
def
|
69 |
-
return
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
λνκ° μ΄κΈ°νλμμ΅λλ€. μλ‘μ΄ μ€μ μΌλ‘ λνλ₯Ό μμν΄μ£ΌμΈμ.
|
80 |
-
"""
|
81 |
-
)
|
82 |
|
83 |
"""
|
84 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
@@ -203,14 +199,6 @@ input[type="range"] {
|
|
203 |
width: 100%;
|
204 |
margin: 10px 0;
|
205 |
}
|
206 |
-
|
207 |
-
/* λͺ¨λ¬ μ€νμΌ */
|
208 |
-
.modal {
|
209 |
-
background: #ffffff;
|
210 |
-
border-radius: 10px;
|
211 |
-
padding: 20px;
|
212 |
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
213 |
-
}
|
214 |
"""
|
215 |
|
216 |
with gr.Blocks(css=custom_css) as demo:
|
@@ -303,20 +291,12 @@ with gr.Blocks(css=custom_css) as demo:
|
|
303 |
label="Top-p"
|
304 |
)
|
305 |
|
306 |
-
# μ€μ λ³κ²½
|
307 |
-
settings_modal = gr.Modal(
|
308 |
-
title="μ€μ μ΄ λ³κ²½λμμ΅λλ€",
|
309 |
-
visible=False,
|
310 |
-
interactive=False,
|
311 |
-
elem_classes="modal"
|
312 |
-
)
|
313 |
-
|
314 |
-
# μ€μ λ³κ²½ μ μ±ν
μ΄κΈ°ν λ° Modal νμ
|
315 |
for component in [agent_type, personality, expertise_level, language]:
|
316 |
component.change(
|
317 |
-
fn=
|
318 |
inputs=[agent_type, personality, expertise_level, language],
|
319 |
-
outputs=
|
320 |
).then(
|
321 |
fn=reset_chat,
|
322 |
outputs=chatbot
|
|
|
65 |
def reset_chat():
|
66 |
return None
|
67 |
|
68 |
+
def show_settings_changed_info(agent_type, personality, expertise_level, language):
|
69 |
+
return f"""
|
70 |
+
μλ‘μ΄ Agent μ€μ :
|
71 |
+
- μ ν: {agent_type}
|
72 |
+
- μ±κ²©: {personality}
|
73 |
+
- μ€λͺ
μμ€: {expertise_level}
|
74 |
+
- μλ΅ μΈμ΄: {language}
|
75 |
+
|
76 |
+
λνκ° μ΄κΈ°νλμμ΅λλ€. μλ‘μ΄ μ€μ μΌλ‘ λνλ₯Ό μμν΄μ£ΌμΈμ.
|
77 |
+
"""
|
|
|
|
|
|
|
|
|
78 |
|
79 |
"""
|
80 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
|
|
199 |
width: 100%;
|
200 |
margin: 10px 0;
|
201 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
"""
|
203 |
|
204 |
with gr.Blocks(css=custom_css) as demo:
|
|
|
291 |
label="Top-p"
|
292 |
)
|
293 |
|
294 |
+
# μ€μ λ³κ²½ μ μ±ν
μ΄κΈ°ν λ° μλ¦Ό νμ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
for component in [agent_type, personality, expertise_level, language]:
|
296 |
component.change(
|
297 |
+
fn=show_settings_changed_info,
|
298 |
inputs=[agent_type, personality, expertise_level, language],
|
299 |
+
outputs=gr.Info()
|
300 |
).then(
|
301 |
fn=reset_chat,
|
302 |
outputs=chatbot
|