openfree commited on
Commit
a028900
Β·
verified Β·
1 Parent(s): c792f55

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +401 -34
app.py CHANGED
@@ -582,61 +582,428 @@ examples = [
582
  # Gradio UI (Blocks) ꡬ성
583
  ##############################################################################
584
  css = """
585
- .gradio-container {
586
- background: white;
587
- padding: 30px 40px;
588
- margin: 20px auto;
589
- width: 100% !important;
590
- max-width: none !important;
591
- }
592
- .fillable {
593
- width: 100% !important;
594
- max-width: 100% !important;
595
  }
 
596
  body {
597
- background: white;
598
  margin: 0;
599
  padding: 0;
600
- font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
601
- color: #333;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
602
  }
 
 
603
  button, .btn {
604
- background: transparent !important;
605
- border: 1px solid #ddd;
606
- color: #333;
607
- padding: 12px 24px;
608
- text-transform: uppercase;
609
- font-weight: bold;
610
- letter-spacing: 1px;
611
- cursor: pointer;
 
 
 
 
 
 
612
  }
 
613
  button:hover, .btn:hover {
614
- background: rgba(0, 0, 0, 0.05) !important;
 
 
615
  }
616
 
617
- h1, h2, h3 {
618
- color: #333;
619
  }
620
 
 
 
 
 
 
 
 
 
 
 
 
621
  .multimodal-textbox, textarea, input {
622
- background: rgba(255, 255, 255, 0.5) !important;
623
- border: 1px solid #ddd;
624
- color: #333;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
625
  }
626
 
627
- .chatbox, .chatbot, .message {
628
- background: transparent !important;
 
629
  }
630
 
631
- #examples_container, .examples-container {
632
- margin: auto;
633
- width: 90%;
634
- background: transparent !important;
635
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
636
  """
637
 
638
  title_html = """
639
- <h1 align="center" style="margin-bottom: 0.2em; font-size: 1.6em;">Gemma-3-R1984-4B-BEAM</h1>
 
 
 
 
 
 
 
 
640
  """
641
 
642
 
 
582
  # Gradio UI (Blocks) ꡬ성
583
  ##############################################################################
584
  css = """
585
+ /* Global Styles */
586
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
587
+
588
+ * {
589
+ box-sizing: border-box;
 
 
 
 
 
590
  }
591
+
592
  body {
 
593
  margin: 0;
594
  padding: 0;
595
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
596
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
597
+ min-height: 100vh;
598
+ color: #2d3748;
599
+ }
600
+
601
+ /* Container Styling */
602
+ .gradio-container {
603
+ background: rgba(255, 255, 255, 0.95);
604
+ backdrop-filter: blur(20px);
605
+ border-radius: 24px;
606
+ padding: 40px;
607
+ margin: 30px auto;
608
+ width: 95% !important;
609
+ max-width: 1400px !important;
610
+ box-shadow:
611
+ 0 25px 50px -12px rgba(0, 0, 0, 0.25),
612
+ 0 0 0 1px rgba(255, 255, 255, 0.05);
613
+ border: 1px solid rgba(255, 255, 255, 0.2);
614
+ }
615
+
616
+ /* Header Styling */
617
+ .header-container {
618
+ text-align: center;
619
+ margin-bottom: 2rem;
620
+ padding: 2rem 0;
621
+ background: linear-gradient(135deg, #f093fb 0%, #f5576c 50%, #4facfe 100%);
622
+ background-clip: text;
623
+ -webkit-background-clip: text;
624
+ -webkit-text-fill-color: transparent;
625
  }
626
+
627
+ /* Button Styling */
628
  button, .btn {
629
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
630
+ border: none !important;
631
+ color: white !important;
632
+ padding: 12px 28px !important;
633
+ border-radius: 12px !important;
634
+ font-weight: 600 !important;
635
+ font-size: 14px !important;
636
+ text-transform: none !important;
637
+ letter-spacing: 0.5px !important;
638
+ cursor: pointer !important;
639
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
640
+ box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4) !important;
641
+ position: relative !important;
642
+ overflow: hidden !important;
643
  }
644
+
645
  button:hover, .btn:hover {
646
+ transform: translateY(-2px) !important;
647
+ box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6) !important;
648
+ background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
649
  }
650
 
651
+ button:active, .btn:active {
652
+ transform: translateY(0) !important;
653
  }
654
 
655
+ /* Primary Action Button */
656
+ button[variant="primary"], .primary-btn {
657
+ background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%) !important;
658
+ box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4) !important;
659
+ }
660
+
661
+ button[variant="primary"]:hover, .primary-btn:hover {
662
+ box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6) !important;
663
+ }
664
+
665
+ /* Input Fields */
666
  .multimodal-textbox, textarea, input {
667
+ background: rgba(255, 255, 255, 0.8) !important;
668
+ backdrop-filter: blur(10px) !important;
669
+ border: 2px solid rgba(102, 126, 234, 0.2) !important;
670
+ border-radius: 16px !important;
671
+ color: #2d3748 !important;
672
+ font-family: 'Inter', sans-serif !important;
673
+ padding: 16px 20px !important;
674
+ transition: all 0.3s ease !important;
675
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
676
+ }
677
+
678
+ .multimodal-textbox:focus, textarea:focus, input:focus {
679
+ border-color: #667eea !important;
680
+ box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 8px 30px rgba(0, 0, 0, 0.15) !important;
681
+ outline: none !important;
682
+ background: rgba(255, 255, 255, 0.95) !important;
683
+ }
684
+
685
+ /* Chat Interface */
686
+ .chatbox, .chatbot {
687
+ background: rgba(255, 255, 255, 0.6) !important;
688
+ backdrop-filter: blur(15px) !important;
689
+ border-radius: 20px !important;
690
+ border: 1px solid rgba(255, 255, 255, 0.3) !important;
691
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
692
+ padding: 24px !important;
693
+ }
694
+
695
+ .message {
696
+ background: rgba(255, 255, 255, 0.9) !important;
697
+ border-radius: 16px !important;
698
+ padding: 16px 20px !important;
699
+ margin: 8px 0 !important;
700
+ border: 1px solid rgba(102, 126, 234, 0.1) !important;
701
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
702
+ transition: all 0.3s ease !important;
703
+ }
704
+
705
+ .message:hover {
706
+ transform: translateY(-1px) !important;
707
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
708
+ }
709
+
710
+ /* Assistant Message Styling */
711
+ .message.assistant {
712
+ background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%) !important;
713
+ border-left: 4px solid #667eea !important;
714
+ }
715
+
716
+ /* User Message Styling */
717
+ .message.user {
718
+ background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(238, 90, 82, 0.1) 100%) !important;
719
+ border-left: 4px solid #ff6b6b !important;
720
+ }
721
+
722
+ /* Cards and Panels */
723
+ .card, .panel {
724
+ background: rgba(255, 255, 255, 0.8) !important;
725
+ backdrop-filter: blur(15px) !important;
726
+ border-radius: 20px !important;
727
+ padding: 24px !important;
728
+ border: 1px solid rgba(255, 255, 255, 0.3) !important;
729
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
730
+ transition: all 0.3s ease !important;
731
+ }
732
+
733
+ .card:hover, .panel:hover {
734
+ transform: translateY(-4px) !important;
735
+ box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15) !important;
736
+ }
737
+
738
+ /* Checkbox Styling */
739
+ input[type="checkbox"] {
740
+ appearance: none !important;
741
+ width: 20px !important;
742
+ height: 20px !important;
743
+ border: 2px solid #667eea !important;
744
+ border-radius: 6px !important;
745
+ background: rgba(255, 255, 255, 0.8) !important;
746
+ cursor: pointer !important;
747
+ transition: all 0.3s ease !important;
748
+ position: relative !important;
749
+ }
750
+
751
+ input[type="checkbox"]:checked {
752
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
753
+ border-color: #667eea !important;
754
+ }
755
+
756
+ input[type="checkbox"]:checked::after {
757
+ content: "βœ“" !important;
758
+ color: white !important;
759
+ font-size: 14px !important;
760
+ font-weight: bold !important;
761
+ position: absolute !important;
762
+ top: 50% !important;
763
+ left: 50% !important;
764
+ transform: translate(-50%, -50%) !important;
765
+ }
766
+
767
+ /* Progress Indicators */
768
+ .progress {
769
+ background: linear-gradient(90deg, #667eea 0%, #764ba2 100%) !important;
770
+ border-radius: 10px !important;
771
+ height: 8px !important;
772
+ }
773
+
774
+ /* Tooltips */
775
+ .tooltip {
776
+ background: rgba(45, 55, 72, 0.95) !important;
777
+ backdrop-filter: blur(10px) !important;
778
+ color: white !important;
779
+ border-radius: 8px !important;
780
+ padding: 8px 12px !important;
781
+ font-size: 12px !important;
782
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
783
+ }
784
+
785
+ /* Slider Styling */
786
+ input[type="range"] {
787
+ appearance: none !important;
788
+ height: 8px !important;
789
+ border-radius: 4px !important;
790
+ background: linear-gradient(90deg, #e2e8f0 0%, #667eea 100%) !important;
791
+ outline: none !important;
792
+ }
793
+
794
+ input[type="range"]::-webkit-slider-thumb {
795
+ appearance: none !important;
796
+ width: 20px !important;
797
+ height: 20px !important;
798
+ border-radius: 50% !important;
799
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
800
+ cursor: pointer !important;
801
+ box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4) !important;
802
+ }
803
+
804
+ /* File Upload Area */
805
+ .file-upload {
806
+ border: 2px dashed #667eea !important;
807
+ border-radius: 16px !important;
808
+ background: rgba(102, 126, 234, 0.05) !important;
809
+ padding: 40px !important;
810
+ text-align: center !important;
811
+ transition: all 0.3s ease !important;
812
+ }
813
+
814
+ .file-upload:hover {
815
+ border-color: #764ba2 !important;
816
+ background: rgba(102, 126, 234, 0.1) !important;
817
+ transform: scale(1.02) !important;
818
+ }
819
+
820
+ /* Animations */
821
+ @keyframes fadeInUp {
822
+ from {
823
+ opacity: 0;
824
+ transform: translateY(30px);
825
+ }
826
+ to {
827
+ opacity: 1;
828
+ transform: translateY(0);
829
+ }
830
+ }
831
+
832
+ @keyframes slideIn {
833
+ from {
834
+ opacity: 0;
835
+ transform: translateX(-20px);
836
+ }
837
+ to {
838
+ opacity: 1;
839
+ transform: translateX(0);
840
+ }
841
+ }
842
+
843
+ .animate-fade-in {
844
+ animation: fadeInUp 0.6s ease-out !important;
845
+ }
846
+
847
+ .animate-slide-in {
848
+ animation: slideIn 0.4s ease-out !important;
849
+ }
850
+
851
+ /* Responsive Design */
852
+ @media (max-width: 768px) {
853
+ .gradio-container {
854
+ margin: 15px !important;
855
+ padding: 24px !important;
856
+ width: calc(100% - 30px) !important;
857
+ }
858
+
859
+ button, .btn {
860
+ padding: 10px 20px !important;
861
+ font-size: 13px !important;
862
+ }
863
+ }
864
+
865
+ /* Dark Mode Support */
866
+ @media (prefers-color-scheme: dark) {
867
+ .gradio-container {
868
+ background: rgba(26, 32, 44, 0.95) !important;
869
+ color: #e2e8f0 !important;
870
+ }
871
+
872
+ .message {
873
+ background: rgba(45, 55, 72, 0.8) !important;
874
+ color: #e2e8f0 !important;
875
+ }
876
  }
877
 
878
+ /* Custom Scrollbar */
879
+ ::-webkit-scrollbar {
880
+ width: 8px !important;
881
  }
882
 
883
+ ::-webkit-scrollbar-track {
884
+ background: rgba(226, 232, 240, 0.3) !important;
885
+ border-radius: 4px !important;
 
886
  }
887
+
888
+ ::-webkit-scrollbar-thumb {
889
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
890
+ border-radius: 4px !important;
891
+ }
892
+
893
+ ::-webkit-scrollbar-thumb:hover {
894
+ background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
895
+ }
896
+ """
897
+
898
+ title_html = """
899
+ <div align="center" style="margin-bottom: 2em; padding: 2rem 0;" class="animate-fade-in">
900
+ <div style="
901
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
902
+ background-clip: text;
903
+ -webkit-background-clip: text;
904
+ -webkit-text-fill-color: transparent;
905
+ margin-bottom: 1rem;
906
+ ">
907
+ <h1 style="
908
+ margin: 0;
909
+ font-size: 3.5em;
910
+ font-weight: 700;
911
+ letter-spacing: -0.02em;
912
+ text-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
913
+ ">
914
+ πŸ€– Robo Beam-Search
915
+ </h1>
916
+ </div>
917
+
918
+ <div style="
919
+ background: rgba(255, 255, 255, 0.9);
920
+ backdrop-filter: blur(15px);
921
+ border-radius: 16px;
922
+ padding: 1.5rem 2rem;
923
+ margin: 1rem auto;
924
+ max-width: 700px;
925
+ border: 1px solid rgba(102, 126, 234, 0.2);
926
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
927
+ ">
928
+ <p style="
929
+ margin: 0.5em 0;
930
+ font-size: 1.1em;
931
+ color: #4a5568;
932
+ font-weight: 500;
933
+ ">
934
+ <span style="
935
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
936
+ background-clip: text;
937
+ -webkit-background-clip: text;
938
+ -webkit-text-fill-color: transparent;
939
+ font-weight: 600;
940
+ ">Base LLM:</span> VIDraft/Gemma-3-R1984-4B
941
+ </p>
942
+ <p style="
943
+ margin: 1em 0 0 0;
944
+ font-size: 1em;
945
+ color: #718096;
946
+ line-height: 1.6;
947
+ font-weight: 400;
948
+ ">
949
+ λΉ„νŒŒκ΄΄ X-RAY 검사/쑰사 이미지에 λŒ€ν•œ μœ„ν—˜ μš”μ†Œ 식별/뢄석 기반 λŒ€ν™”ν˜• μ˜¨ν”„λ ˆλ―ΈμŠ€ AI ν”Œλž«νΌ
950
+ </p>
951
+ </div>
952
+
953
+ <div style="
954
+ display: flex;
955
+ justify-content: center;
956
+ gap: 1rem;
957
+ margin-top: 2rem;
958
+ flex-wrap: wrap;
959
+ ">
960
+ <div style="
961
+ background: rgba(102, 126, 234, 0.1);
962
+ border: 1px solid rgba(102, 126, 234, 0.3);
963
+ border-radius: 12px;
964
+ padding: 0.5rem 1rem;
965
+ font-size: 0.9em;
966
+ color: #667eea;
967
+ font-weight: 500;
968
+ ">
969
+ πŸ” X-RAY 뢄석
970
+ </div>
971
+ <div style="
972
+ background: rgba(118, 75, 162, 0.1);
973
+ border: 1px solid rgba(118, 75, 162, 0.3);
974
+ border-radius: 12px;
975
+ padding: 0.5rem 1rem;
976
+ font-size: 0.9em;
977
+ color: #764ba2;
978
+ font-weight: 500;
979
+ ">
980
+ πŸ›‘οΈ λ³΄μ•ˆ μŠ€μΊλ‹
981
+ </div>
982
+ <div style="
983
+ background: rgba(240, 147, 251, 0.1);
984
+ border: 1px solid rgba(240, 147, 251, 0.3);
985
+ border-radius: 12px;
986
+ padding: 0.5rem 1rem;
987
+ font-size: 0.9em;
988
+ color: #f093fb;
989
+ font-weight: 500;
990
+ ">
991
+ 🌐 μ›Ή 검색
992
+ </div>
993
+ </div>
994
+ </div>
995
  """
996
 
997
  title_html = """
998
+ <div align="center" style="margin-bottom: 1em;">
999
+ <h1 style="margin-bottom: 0.2em; font-size: 1.8em; color: #333;">πŸ€– Robo Beam-Search</h1>
1000
+ <p style="margin: 0.5em 0; font-size: 1em; color: #666;">
1001
+ <strong>Base LLM:</strong> VIDraft/Gemma-3-R1984-4B
1002
+ </p>
1003
+ <p style="margin: 0.5em 0; font-size: 0.9em; color: #888; max-width: 600px; margin-left: auto; margin-right: auto;">
1004
+ λΉ„νŒŒκ΄΄ X-RAY 검사/쑰사 이미지에 λŒ€ν•œ μœ„ν—˜ μš”μ†Œ 식별/뢄석 기반 λŒ€ν™”ν˜• μ˜¨ν”„λ ˆλ―ΈμŠ€ AI ν”Œλž«νΌ
1005
+ </p>
1006
+ </div>
1007
  """
1008
 
1009