Kim Juwon commited on
Commit
4b1f53c
Β·
1 Parent(s): 86e2ae0

update UI/UX

Browse files
Files changed (1) hide show
  1. app.py +13 -33
app.py CHANGED
@@ -65,20 +65,16 @@ def respond(
65
  def reset_chat():
66
  return None
67
 
68
- def show_settings_changed_modal(agent_type, personality, expertise_level, language):
69
- return gr.Modal.update(
70
- visible=True,
71
- title="섀정이 λ³€κ²½λ˜μ—ˆμŠ΅λ‹ˆλ‹€",
72
- value=f"""
73
- μƒˆλ‘œμš΄ Agent μ„€μ •:
74
- - μœ ν˜•: {agent_type}
75
- - 성격: {personality}
76
- - μ„€λͺ… μˆ˜μ€€: {expertise_level}
77
- - 응닡 μ–Έμ–΄: {language}
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
- # μ„€μ • λ³€κ²½ μ•Œλ¦Όμ„ μœ„ν•œ Modal
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=show_settings_changed_modal,
318
  inputs=[agent_type, personality, expertise_level, language],
319
- outputs=settings_modal
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