cutechicken commited on
Commit
7f1dbfb
โ€ข
1 Parent(s): 3cfd908

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +96 -24
app.py CHANGED
@@ -415,6 +415,69 @@ body {
415
  .slider::-webkit-slider-thumb:hover {
416
  transform: scale(1.2);
417
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
418
  """
419
 
420
  # UI ๊ตฌ์„ฑ ์ˆ˜์ •
@@ -422,31 +485,41 @@ with gr.Blocks(css=CSS) as demo:
422
  with gr.Column():
423
  chatbot = gr.Chatbot(
424
  value=[],
425
- height=500,
426
  label="GiniGEN AI Assistant",
427
- elem_classes="chatbot"
428
  )
429
 
430
- with gr.Row(elem_classes="input-area"):
431
- file_upload = gr.File(
432
- label="๐Ÿ“Ž ํŒŒ์ผ ์ฒจ๋ถ€",
433
- type="filepath",
434
- scale=1, # ์ •์ˆ˜๊ฐ’์œผ๋กœ ์ˆ˜์ •
435
- min_width=50,
436
- elem_classes="file-upload-button"
437
- )
438
- msg = gr.Textbox(
439
- show_label=False,
440
- placeholder="๋ฉ”์‹œ์ง€๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”... ๐Ÿ’ญ",
441
- scale=4, # ์ •์ˆ˜๊ฐ’์œผ๋กœ ์ˆ˜์ •
442
- container=False
443
- )
444
- send = gr.Button(
445
- "์ „์†ก",
446
- scale=1, # ์ •์ˆ˜๊ฐ’์œผ๋กœ ์ˆ˜์ •
447
- min_width=50,
448
- elem_classes="custom-button"
449
- )
 
 
 
 
 
 
 
 
 
 
450
 
451
  with gr.Accordion("๐ŸŽฎ ๊ณ ๊ธ‰ ์„ค์ •", open=False, elem_classes="settings-panel"):
452
  with gr.Row():
@@ -478,7 +551,6 @@ with gr.Blocks(css=CSS) as demo:
478
  elem_classes="slider"
479
  )
480
 
481
- # Examples ์ปดํฌ๋„ŒํŠธ ์ˆ˜์ •
482
  gr.Examples(
483
  examples=[
484
  ["ํ•œ๊ตญ์˜ ์ „ํ†ต ์ ˆ๊ธฐ์™€ 24์ ˆ๊ธฐ์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์„ค๋ช…ํ•ด์ฃผ์„ธ์š”."],
@@ -516,4 +588,4 @@ with gr.Blocks(css=CSS) as demo:
516
  )
517
 
518
  if __name__ == "__main__":
519
- demo.launch()
 
415
  .slider::-webkit-slider-thumb:hover {
416
  transform: scale(1.2);
417
  }
418
+
419
+
420
+ .chat-container {
421
+ height: 700px !important; /* ์ฑ„ํŒ…์ฐฝ ๋†’์ด ์ฆ๊ฐ€ */
422
+ margin-bottom: 10px;
423
+ }
424
+
425
+ .input-container {
426
+ height: 45px !important; /* ์ž…๋ ฅ์ฐฝ ๋†’์ด ๊ฐ์†Œ */
427
+ display: flex;
428
+ align-items: center;
429
+ gap: 10px;
430
+ margin-top: 5px;
431
+ }
432
+
433
+ .file-upload-icon {
434
+ background: linear-gradient(145deg, #64b5f6, #42a5f5);
435
+ color: white;
436
+ border-radius: 8px;
437
+ padding: 8px 12px;
438
+ font-size: 0.9em;
439
+ cursor: pointer;
440
+ display: flex;
441
+ align-items: center;
442
+ gap: 5px;
443
+ height: 35px;
444
+ transition: all 0.3s ease;
445
+ box-shadow: 0 2px 5px rgba(0,0,0,0.1);
446
+ }
447
+
448
+ .file-upload-icon:hover {
449
+ transform: translateY(-2px);
450
+ box-shadow: 0 4px 8px rgba(0,0,0,0.2);
451
+ }
452
+
453
+ .file-upload-icon svg {
454
+ width: 20px;
455
+ height: 20px;
456
+ }
457
+
458
+ .input-textbox {
459
+ height: 35px !important;
460
+ border-radius: 8px !important;
461
+ }
462
+
463
+ .send-button {
464
+ height: 35px !important;
465
+ min-width: 60px !important;
466
+ }
467
+
468
+ /* ํŒŒ์ผ ์—…๋กœ๋“œ ๋ฒ„ํŠผ ์ปจํ…Œ์ด๋„ˆ */
469
+ .file-upload-container {
470
+ display: flex;
471
+ align-items: center;
472
+ height: 35px;
473
+ }
474
+
475
+ /* ํŒŒ์ผ ์—…๋กœ๋“œ ํ…์ŠคํŠธ */
476
+ .file-upload-text {
477
+ font-size: 0.8em;
478
+ margin-left: 5px;
479
+ color: #ffffff;
480
+ }
481
  """
482
 
483
  # UI ๊ตฌ์„ฑ ์ˆ˜์ •
 
485
  with gr.Column():
486
  chatbot = gr.Chatbot(
487
  value=[],
488
+ height=700, # ์ฑ„ํŒ…์ฐฝ ๋†’์ด ์ฆ๊ฐ€
489
  label="GiniGEN AI Assistant",
490
+ elem_classes="chat-container"
491
  )
492
 
493
+ with gr.Row(elem_classes="input-container"):
494
+ with gr.Column(scale=1, min_width=150):
495
+ file_upload = gr.File(
496
+ label="๐Ÿ“",
497
+ type="filepath",
498
+ elem_classes="file-upload-icon",
499
+ scale=1,
500
+ container=True,
501
+ interactive=True,
502
+ )
503
+ gr.Markdown(
504
+ "Txt/Csv/Parquet",
505
+ elem_classes="file-upload-text"
506
+ )
507
+
508
+ with gr.Column(scale=4):
509
+ msg = gr.Textbox(
510
+ show_label=False,
511
+ placeholder="๋ฉ”์‹œ์ง€๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”... ๐Ÿ’ญ",
512
+ container=False,
513
+ elem_classes="input-textbox",
514
+ scale=1
515
+ )
516
+
517
+ with gr.Column(scale=1, min_width=60):
518
+ send = gr.Button(
519
+ "์ „์†ก",
520
+ elem_classes="send-button custom-button",
521
+ scale=1
522
+ )
523
 
524
  with gr.Accordion("๐ŸŽฎ ๊ณ ๊ธ‰ ์„ค์ •", open=False, elem_classes="settings-panel"):
525
  with gr.Row():
 
551
  elem_classes="slider"
552
  )
553
 
 
554
  gr.Examples(
555
  examples=[
556
  ["ํ•œ๊ตญ์˜ ์ „ํ†ต ์ ˆ๊ธฐ์™€ 24์ ˆ๊ธฐ์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์„ค๋ช…ํ•ด์ฃผ์„ธ์š”."],
 
588
  )
589
 
590
  if __name__ == "__main__":
591
+ demo.launch()