Update app.py
Browse files
app.py
CHANGED
@@ -780,64 +780,50 @@ def create_interface():
|
|
780 |
color: white !important;
|
781 |
}
|
782 |
|
783 |
-
/*
|
784 |
.file-upload-container {
|
785 |
margin-left: 15px;
|
786 |
-
width: 150px;
|
787 |
-
height: 40px;
|
788 |
display: inline-block;
|
789 |
-
vertical-align:
|
790 |
-
position: relative;
|
791 |
}
|
792 |
|
793 |
-
/* Hide
|
794 |
.file-upload-container .file-preview,
|
795 |
-
.file-upload-container .
|
796 |
-
.file-upload-container p,
|
797 |
.file-upload-container svg,
|
798 |
-
.file-upload-container
|
799 |
-
.file-upload-container [data-testid="droparea"] {
|
800 |
display: none !important;
|
801 |
}
|
802 |
|
803 |
-
/* Style the
|
804 |
-
.file-upload-container
|
805 |
-
position: absolute !important;
|
806 |
-
top: 0 !important;
|
807 |
-
left: 0 !important;
|
808 |
-
width: 100% !important;
|
809 |
-
height: 40px !important;
|
810 |
-
padding: 0 15px !important;
|
811 |
background-color: #f0f0f0 !important;
|
812 |
border: 1px solid #d9d9d9 !important;
|
813 |
border-radius: 4px !important;
|
|
|
|
|
814 |
display: flex !important;
|
815 |
align-items: center !important;
|
816 |
-
justify-content:
|
817 |
-
|
818 |
}
|
819 |
|
820 |
-
/* Style the
|
821 |
-
.file-upload-container
|
|
|
822 |
font-size: 14px !important;
|
823 |
font-weight: normal !important;
|
824 |
-
|
825 |
-
display: inline-block !important;
|
826 |
-
}
|
827 |
-
|
828 |
-
/* Hover effect */
|
829 |
-
.file-upload-container > div:last-child:hover {
|
830 |
-
background-color: #e0e0e0 !important;
|
831 |
}
|
832 |
|
833 |
-
/* Hide
|
834 |
-
.file-upload-container * {
|
835 |
-
|
836 |
}
|
837 |
|
838 |
-
/*
|
839 |
-
.file-upload-container
|
840 |
-
|
841 |
}
|
842 |
"""
|
843 |
|
@@ -869,10 +855,13 @@ def create_interface():
|
|
869 |
)
|
870 |
|
871 |
with gr.Column(elem_classes=["file-upload-container"], scale=0):
|
|
|
|
|
|
|
872 |
file_upload = gr.File(
|
873 |
file_types=["image", "pdf", "doc", "docx"],
|
874 |
type="binary",
|
875 |
-
label="
|
876 |
)
|
877 |
|
878 |
# Analyze button
|
|
|
780 |
color: white !important;
|
781 |
}
|
782 |
|
783 |
+
/* Style the file upload container */
|
784 |
.file-upload-container {
|
785 |
margin-left: 15px;
|
|
|
|
|
786 |
display: inline-block;
|
787 |
+
vertical-align: top;
|
|
|
788 |
}
|
789 |
|
790 |
+
/* Hide all elements except what we want */
|
791 |
.file-upload-container .file-preview,
|
792 |
+
.file-upload-container p:not(.drop-text),
|
|
|
793 |
.file-upload-container svg,
|
794 |
+
.file-upload-container label span {
|
|
|
795 |
display: none !important;
|
796 |
}
|
797 |
|
798 |
+
/* Style the drop area properly */
|
799 |
+
.file-upload-container [data-testid="chunkFileDropArea"] {
|
|
|
|
|
|
|
|
|
|
|
|
|
800 |
background-color: #f0f0f0 !important;
|
801 |
border: 1px solid #d9d9d9 !important;
|
802 |
border-radius: 4px !important;
|
803 |
+
height: 42px !important; /* Slightly taller to align with radio buttons */
|
804 |
+
padding: 10px 15px !important;
|
805 |
display: flex !important;
|
806 |
align-items: center !important;
|
807 |
+
justify-content: flex-start !important;
|
808 |
+
width: 320px !important;
|
809 |
}
|
810 |
|
811 |
+
/* Style the drop text */
|
812 |
+
.file-upload-container .drop-text {
|
813 |
+
margin: 0 !important;
|
814 |
font-size: 14px !important;
|
815 |
font-weight: normal !important;
|
816 |
+
color: #555 !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
817 |
}
|
818 |
|
819 |
+
/* Hide "or" text but keep "Drop File Here" */
|
820 |
+
.file-upload-container .drop-text + * {
|
821 |
+
display: none !important;
|
822 |
}
|
823 |
|
824 |
+
/* Hover effect */
|
825 |
+
.file-upload-container [data-testid="chunkFileDropArea"]:hover {
|
826 |
+
background-color: #e0e0e0 !important;
|
827 |
}
|
828 |
"""
|
829 |
|
|
|
855 |
)
|
856 |
|
857 |
with gr.Column(elem_classes=["file-upload-container"], scale=0):
|
858 |
+
# Add a special class to identify and style the drop text
|
859 |
+
gr.HTML("<p class='drop-text'>Drop File Here</p>", visible=False)
|
860 |
+
|
861 |
file_upload = gr.File(
|
862 |
file_types=["image", "pdf", "doc", "docx"],
|
863 |
type="binary",
|
864 |
+
label=""
|
865 |
)
|
866 |
|
867 |
# Analyze button
|