Kims12 commited on
Commit
0b12c58
·
verified ·
1 Parent(s): b67bf33

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -22
app.py CHANGED
@@ -156,7 +156,7 @@ with gr.Blocks() as demo:
156
  gr.Markdown("# Prompting AI - 일반 문답형 데모")
157
  gr.Markdown("언어모델별 문답형 테스트 데모입니다. 한 번에 한 질문씩만 주고받습니다.")
158
 
159
- # -- 프레임(한 줄)에 토큰 입력 3개 배치 --
160
  with gr.Row():
161
  hf_token_box = gr.Textbox(
162
  label="HuggingFace 토큰 (비공개)",
@@ -177,12 +177,18 @@ with gr.Blocks() as demo:
177
 
178
  # --- Tab: 일반 모델 ---
179
  with gr.Tab("일반 모델"):
 
180
  model_name = gr.Radio(
181
  choices=list(MODELS.keys()),
182
  label="Language Model (HuggingFace)",
183
  value="Zephyr 7B Beta"
184
  )
185
 
 
 
 
 
 
186
  with gr.Accordion("고급 설정 (일반 모델)", open=False):
187
  max_tokens = gr.Slider(minimum=0, maximum=2000, value=500, step=100, label="Max Tokens")
188
  temperature = gr.Slider(minimum=0.1, maximum=2.0, value=0.7, step=0.05, label="Temperature")
@@ -196,9 +202,6 @@ with gr.Blocks() as demo:
196
  lines=3
197
  )
198
 
199
- question_input = gr.Textbox(label="질문을 입력하세요")
200
- answer_output = gr.Textbox(label="답변", interactive=False)
201
-
202
  submit_button = gr.Button("전송")
203
 
204
  submit_button.click(
@@ -217,6 +220,10 @@ with gr.Blocks() as demo:
217
 
218
  # --- Tab: Cohere Command R+ ---
219
  with gr.Tab("Cohere Command R+"):
 
 
 
 
220
  with gr.Accordion("고급 설정 (Cohere)", open=False):
221
  cohere_system_message = gr.Textbox(
222
  value="""반드시 한글로 답변할 것.
@@ -230,9 +237,6 @@ with gr.Blocks() as demo:
230
  cohere_temperature = gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature")
231
  cohere_top_p = gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-P")
232
 
233
- cohere_question_input = gr.Textbox(label="질문을 입력하세요")
234
- cohere_answer_output = gr.Textbox(label="답변", interactive=False)
235
-
236
  cohere_submit_button = gr.Button("전송")
237
 
238
  cohere_submit_button.click(
@@ -250,6 +254,10 @@ with gr.Blocks() as demo:
250
 
251
  # --- Tab: ChatGPT ---
252
  with gr.Tab("gpt-4o-mini"):
 
 
 
 
253
  with gr.Accordion("고급 설정 (ChatGPT)", open=False):
254
  chatgpt_system_message = gr.Textbox(
255
  value="""반드시 한글로 답변할 것.
@@ -263,9 +271,6 @@ with gr.Blocks() as demo:
263
  chatgpt_temperature = gr.Slider(minimum=0.1, maximum=2.0, value=0.7, step=0.05, label="Temperature")
264
  chatgpt_top_p = gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-P")
265
 
266
- chatgpt_question_input = gr.Textbox(label="질문을 입력하세요")
267
- chatgpt_answer_output = gr.Textbox(label="답변", interactive=False)
268
-
269
  chatgpt_submit_button = gr.Button("전송")
270
 
271
  chatgpt_submit_button.click(
@@ -333,6 +338,18 @@ with gr.Blocks() as demo:
333
  with gr.Tab("claude-3-haiku"):
334
  gr.Markdown("claude-3-haiku모델")
335
 
 
 
 
 
 
 
 
 
 
 
 
 
336
  with gr.Accordion("고급 설정 (Claude)", open=False):
337
  claude_system_message = gr.Textbox(
338
  label="System Message",
@@ -363,18 +380,6 @@ with gr.Blocks() as demo:
363
  label="Top-p"
364
  )
365
 
366
- claude_question_input = gr.Textbox(
367
- label="질문을 입력하세요",
368
- lines=3,
369
- placeholder="질문을 입력하세요..."
370
- )
371
-
372
- claude_answer_output = gr.Textbox(
373
- label="답변",
374
- interactive=False,
375
- lines=10
376
- )
377
-
378
  claude_submit_button = gr.Button("전송")
379
 
380
  claude_submit_button.click(
 
156
  gr.Markdown("# Prompting AI - 일반 문답형 데모")
157
  gr.Markdown("언어모델별 문답형 테스트 데모입니다. 한 번에 한 질문씩만 주고받습니다.")
158
 
159
+ # 한 줄에 토큰 텍스트박스 배치
160
  with gr.Row():
161
  hf_token_box = gr.Textbox(
162
  label="HuggingFace 토큰 (비공개)",
 
177
 
178
  # --- Tab: 일반 모델 ---
179
  with gr.Tab("일반 모델"):
180
+ # 모델명 선택은 그대로 상단에 둠
181
  model_name = gr.Radio(
182
  choices=list(MODELS.keys()),
183
  label="Language Model (HuggingFace)",
184
  value="Zephyr 7B Beta"
185
  )
186
 
187
+ # 질문(5칸), 답변(5칸)
188
+ question_input = gr.Textbox(label="질문을 입력하세요", lines=5)
189
+ answer_output = gr.Textbox(label="답변", lines=5, interactive=False)
190
+
191
+ # 설정(Advanced Settings)을 답변 아래에 둠
192
  with gr.Accordion("고급 설정 (일반 모델)", open=False):
193
  max_tokens = gr.Slider(minimum=0, maximum=2000, value=500, step=100, label="Max Tokens")
194
  temperature = gr.Slider(minimum=0.1, maximum=2.0, value=0.7, step=0.05, label="Temperature")
 
202
  lines=3
203
  )
204
 
 
 
 
205
  submit_button = gr.Button("전송")
206
 
207
  submit_button.click(
 
220
 
221
  # --- Tab: Cohere Command R+ ---
222
  with gr.Tab("Cohere Command R+"):
223
+ # 질문(5칸), 답변(5칸)
224
+ cohere_question_input = gr.Textbox(label="질문을 입력하세요", lines=5)
225
+ cohere_answer_output = gr.Textbox(label="답변", lines=5, interactive=False)
226
+
227
  with gr.Accordion("고급 설정 (Cohere)", open=False):
228
  cohere_system_message = gr.Textbox(
229
  value="""반드시 한글로 답변할 것.
 
237
  cohere_temperature = gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature")
238
  cohere_top_p = gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-P")
239
 
 
 
 
240
  cohere_submit_button = gr.Button("전송")
241
 
242
  cohere_submit_button.click(
 
254
 
255
  # --- Tab: ChatGPT ---
256
  with gr.Tab("gpt-4o-mini"):
257
+ # 질문(5칸), 답변(5칸)
258
+ chatgpt_question_input = gr.Textbox(label="질문을 입력하세요", lines=5)
259
+ chatgpt_answer_output = gr.Textbox(label="답변", lines=5, interactive=False)
260
+
261
  with gr.Accordion("고급 설정 (ChatGPT)", open=False):
262
  chatgpt_system_message = gr.Textbox(
263
  value="""반드시 한글로 답변할 것.
 
271
  chatgpt_temperature = gr.Slider(minimum=0.1, maximum=2.0, value=0.7, step=0.05, label="Temperature")
272
  chatgpt_top_p = gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-P")
273
 
 
 
 
274
  chatgpt_submit_button = gr.Button("전송")
275
 
276
  chatgpt_submit_button.click(
 
338
  with gr.Tab("claude-3-haiku"):
339
  gr.Markdown("claude-3-haiku모델")
340
 
341
+ # 질문(5칸), 답변(5칸)
342
+ claude_question_input = gr.Textbox(
343
+ label="질문을 입력하세요",
344
+ lines=5,
345
+ placeholder="질문을 입력하세요..."
346
+ )
347
+ claude_answer_output = gr.Textbox(
348
+ label="답변",
349
+ interactive=False,
350
+ lines=5
351
+ )
352
+
353
  with gr.Accordion("고급 설정 (Claude)", open=False):
354
  claude_system_message = gr.Textbox(
355
  label="System Message",
 
380
  label="Top-p"
381
  )
382
 
 
 
 
 
 
 
 
 
 
 
 
 
383
  claude_submit_button = gr.Button("전송")
384
 
385
  claude_submit_button.click(