cutechicken commited on
Commit
6e53936
โ€ข
1 Parent(s): fd896d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +72 -61
app.py CHANGED
@@ -341,7 +341,6 @@ body {
341
  background: linear-gradient(145deg, #64b5f6, #42a5f5);
342
  color: white;
343
  border-radius: 8px;
344
- padding: 8px 12px;
345
  font-size: 2em;
346
  cursor: pointer;
347
  display: flex;
@@ -353,19 +352,20 @@ body {
353
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
354
  }
355
 
356
- .file-upload-icon:hover {
357
- transform: translateY(-2px);
358
- box-shadow: 0 4px 8px rgba(0,0,0,0.2);
359
  }
360
 
361
- .file-upload-icon svg {
362
- width: 35px;
363
- height: 35px;
 
364
  }
365
 
366
- /* ํŒŒ์ผ ์—…๋กœ๋“œ ๋ผ๋ฒจ ์ˆจ๊ธฐ๊ธฐ */
367
- .file-upload-icon label {
368
- display: none !important;
369
  }
370
 
371
  /* ๋ฉ”์‹œ์ง€ ์Šคํƒ€์ผ */
@@ -389,7 +389,7 @@ body {
389
  .settings-panel {
390
  background: var(--card-background);
391
  border-radius: 15px;
392
- padding: 30px;
393
  margin-top: 20px;
394
  box-shadow:
395
  0 5px 15px var(--shadow-color),
@@ -398,15 +398,29 @@ body {
398
  transition: all 0.3s ease;
399
  }
400
 
401
- .settings-panel:hover {
402
- transform: translateZ(5px);
 
 
 
 
 
 
403
  }
404
 
405
- /* ์Šฌ๋ผ์ด๋” ์Šคํƒ€์ผ */
406
  .slider-container {
 
 
 
 
 
 
407
  margin: 25px 0;
 
408
  }
409
 
 
410
  .slider {
411
  -webkit-appearance: none;
412
  width: 100%;
@@ -414,7 +428,7 @@ body {
414
  border-radius: 5px;
415
  background: #ddd;
416
  outline: none;
417
- margin: 25px 0;
418
  }
419
 
420
  .slider::-webkit-slider-thumb {
@@ -457,21 +471,6 @@ body {
457
  min-width: 70px !important;
458
  font-size: 1.1em !important;
459
  }
460
-
461
- /* ๊ณ ๊ธ‰ ์„ค์ • ๋ ˆ์ด๋ธ” ์Šคํƒ€์ผ */
462
- .settings-label {
463
- font-size: 1.2em;
464
- font-weight: 500;
465
- margin: 20px 0;
466
- color: var(--text-color);
467
- }
468
-
469
- /* ์Šฌ๋ผ์ด๋” ๋ ˆ์ด๋ธ” ์Šคํƒ€์ผ */
470
- .slider-label {
471
- font-size: 1.1em;
472
- margin: 15px 0;
473
- color: var(--text-color);
474
- }
475
  """
476
 
477
  # UI ๊ตฌ์„ฑ
@@ -492,7 +491,8 @@ with gr.Blocks(css=CSS) as demo:
492
  scale=1,
493
  container=True,
494
  interactive=True,
495
- show_label=False # ๋ผ๋ฒจ ์ˆจ๊ธฐ๊ธฐ
 
496
  )
497
 
498
  with gr.Column(scale=4):
@@ -514,39 +514,50 @@ with gr.Blocks(css=CSS) as demo:
514
  with gr.Accordion("๐ŸŽฎ ๊ณ ๊ธ‰ ์„ค์ •", open=False, elem_classes="settings-panel"):
515
  with gr.Row():
516
  with gr.Column(scale=1):
517
- gr.Markdown("### ์ƒ์„ฑ ๋งค๊ฐœ๋ณ€์ˆ˜", elem_classes="settings-label")
518
- temperature = gr.Slider(
519
- minimum=0, maximum=1, step=0.1, value=0.8,
520
- label="์ฐฝ์˜์„ฑ ์ˆ˜์ค€ ๐ŸŽจ",
521
- elem_classes="slider",
522
- container=True
523
- )
524
- max_new_tokens = gr.Slider(
525
- minimum=128, maximum=8000, step=1, value=4000,
526
- label="์ตœ๋Œ€ ํ† ํฐ ์ˆ˜ ๐Ÿ“",
527
- elem_classes="slider",
528
- container=True
529
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
530
  with gr.Column(scale=1):
531
- gr.Markdown("### ์ œ์–ด ๋งค๊ฐœ๋ณ€์ˆ˜", elem_classes="settings-label")
532
- top_p = gr.Slider(
533
- minimum=0.0, maximum=1.0, step=0.1, value=0.8,
534
- label="๋‹ค์–‘์„ฑ ์กฐ์ ˆ ๐ŸŽฏ",
535
- elem_classes="slider",
536
- container=True
537
- )
538
- top_k = gr.Slider(
539
- minimum=1, maximum=20, step=1, value=20,
540
- label="์„ ํƒ ๏ฟฝ๏ฟฝ๏ฟฝ์œ„ ๐Ÿ“Š",
541
- elem_classes="slider",
542
- container=True
543
- )
544
- penalty = gr.Slider(
545
- minimum=0.0, maximum=2.0, step=0.1, value=1.0,
546
- label="๋ฐ˜๋ณต ์–ต์ œ ๐Ÿ”„",
547
- elem_classes="slider",
548
- container=True
549
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
550
 
551
  gr.Examples(
552
  examples=[
 
341
  background: linear-gradient(145deg, #64b5f6, #42a5f5);
342
  color: white;
343
  border-radius: 8px;
 
344
  font-size: 2em;
345
  cursor: pointer;
346
  display: flex;
 
352
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
353
  }
354
 
355
+ /* ํŒŒ์ผ ์—…๋กœ๋“œ ๊ด€๋ จ ๋ชจ๋“  ํ…์ŠคํŠธ ์ˆจ๊ธฐ๊ธฐ */
356
+ .file-upload-icon * {
357
+ display: none !important;
358
  }
359
 
360
+ .file-upload-icon::before {
361
+ content: "๐Ÿ“";
362
+ display: block !important;
363
+ font-size: 2em;
364
  }
365
 
366
+ .file-upload-icon:hover {
367
+ transform: translateY(-2px);
368
+ box-shadow: 0 4px 8px rgba(0,0,0,0.2);
369
  }
370
 
371
  /* ๋ฉ”์‹œ์ง€ ์Šคํƒ€์ผ */
 
389
  .settings-panel {
390
  background: var(--card-background);
391
  border-radius: 15px;
392
+ padding: 40px;
393
  margin-top: 20px;
394
  box-shadow:
395
  0 5px 15px var(--shadow-color),
 
398
  transition: all 0.3s ease;
399
  }
400
 
401
+ /* ์„ค์ • ์„น์…˜ ์ œ๋ชฉ */
402
+ .settings-section {
403
+ font-size: 1.3em;
404
+ font-weight: 600;
405
+ color: var(--text-color);
406
+ margin: 30px 0;
407
+ padding-bottom: 15px;
408
+ border-bottom: 2px solid var(--primary-color);
409
  }
410
 
411
+ /* ์Šฌ๋ผ์ด๋” ์ปจํ…Œ์ด๋„ˆ */
412
  .slider-container {
413
+ margin: 40px 0;
414
+ }
415
+
416
+ /* ์Šฌ๋ผ์ด๋” ๋ ˆ์ด๋ธ” */
417
+ .slider-label {
418
+ font-size: 1.1em;
419
  margin: 25px 0;
420
+ color: var(--text-color);
421
  }
422
 
423
+ /* ์Šฌ๋ผ์ด๋” */
424
  .slider {
425
  -webkit-appearance: none;
426
  width: 100%;
 
428
  border-radius: 5px;
429
  background: #ddd;
430
  outline: none;
431
+ margin: 35px 0;
432
  }
433
 
434
  .slider::-webkit-slider-thumb {
 
471
  min-width: 70px !important;
472
  font-size: 1.1em !important;
473
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
474
  """
475
 
476
  # UI ๊ตฌ์„ฑ
 
491
  scale=1,
492
  container=True,
493
  interactive=True,
494
+ show_label=False,
495
+ label=""
496
  )
497
 
498
  with gr.Column(scale=4):
 
514
  with gr.Accordion("๐ŸŽฎ ๊ณ ๊ธ‰ ์„ค์ •", open=False, elem_classes="settings-panel"):
515
  with gr.Row():
516
  with gr.Column(scale=1):
517
+ gr.Markdown(
518
+ "### ์ƒ์„ฑ ๋งค๊ฐœ๋ณ€์ˆ˜",
519
+ elem_classes="settings-section"
 
 
 
 
 
 
 
 
 
520
  )
521
+ with gr.Column(elem_classes="slider-container"):
522
+ temperature = gr.Slider(
523
+ minimum=0, maximum=1, step=0.1, value=0.8,
524
+ label="์ฐฝ์˜์„ฑ ์ˆ˜์ค€ ๐ŸŽจ",
525
+ elem_classes="slider",
526
+ container=True
527
+ )
528
+ with gr.Column(elem_classes="slider-container"):
529
+ max_new_tokens = gr.Slider(
530
+ minimum=128, maximum=8000, step=1, value=4000,
531
+ label="์ตœ๋Œ€ ํ† ํฐ ์ˆ˜ ๐Ÿ“",
532
+ elem_classes="slider",
533
+ container=True
534
+ )
535
  with gr.Column(scale=1):
536
+ gr.Markdown(
537
+ "### ์ œ์–ด ๋งค๊ฐœ๋ณ€์ˆ˜",
538
+ elem_classes="settings-section"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
539
  )
540
+ with gr.Column(elem_classes="slider-container"):
541
+ top_p = gr.Slider(
542
+ minimum=0.0, maximum=1.0, step=0.1, value=0.8,
543
+ label="๋‹ค์–‘์„ฑ ์กฐ์ ˆ ๐ŸŽฏ",
544
+ elem_classes="slider",
545
+ container=True
546
+ )
547
+ with gr.Column(elem_classes="slider-container"):
548
+ top_k = gr.Slider(
549
+ minimum=1, maximum=20, step=1, value=20,
550
+ label="์„ ํƒ ๋ฒ”์œ„ ๐Ÿ“Š",
551
+ elem_classes="slider",
552
+ container=True
553
+ )
554
+ with gr.Column(elem_classes="slider-container"):
555
+ penalty = gr.Slider(
556
+ minimum=0.0, maximum=2.0, step=0.1, value=1.0,
557
+ label="๋ฐ˜๋ณต ์–ต์ œ ๐Ÿ”„",
558
+ elem_classes="slider",
559
+ container=True
560
+ )
561
 
562
  gr.Examples(
563
  examples=[