ApsidalSolid4 commited on
Commit
eec7a1b
·
verified ·
1 Parent(s): 1b48fdb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -25
app.py CHANGED
@@ -780,49 +780,46 @@ def create_interface():
780
  color: white !important;
781
  }
782
 
783
- /* Target the file component container */
784
- [data-testid="file"] {
785
- margin-left: 15px !important;
786
  width: 150px !important;
 
787
  }
788
 
789
- /* Hide the File label */
790
- [data-testid="file"] > label {
 
 
 
 
791
  display: none !important;
792
  }
793
 
794
- /* Style the drop zone to look like a button */
795
- [data-testid="file"] [data-testid="drop-region"] {
796
  height: 40px !important;
797
- min-height: 40px !important;
798
  background-color: #f0f0f0 !important;
799
  border: 1px solid #d9d9d9 !important;
800
  border-radius: 4px !important;
 
 
801
  display: flex !important;
802
  align-items: center !important;
803
  justify-content: center !important;
 
804
  padding: 0 !important;
805
  }
806
 
807
- /* Hide all elements inside except our custom text */
808
- [data-testid="file"] [data-testid="drop-region"] > * {
809
  display: none !important;
810
  }
811
 
812
- /* Add custom button text */
813
- [data-testid="file"] [data-testid="drop-region"]::before {
814
- content: "Upload Document" !important;
815
- font-size: 14px !important;
816
- color: #333 !important;
817
- }
818
-
819
- /* Hide the drag text area, preview area, etc. */
820
- [data-testid="file"] [data-testid="download-button"],
821
- [data-testid="file"] [data-testid="clear-button"],
822
- [data-testid="file"] [data-testid="gallery"],
823
- [data-testid="file"] [data-testid="preview"],
824
- [data-testid="file"] p {
825
- display: none !important;
826
  }
827
  """
828
 
@@ -857,7 +854,7 @@ def create_interface():
857
  file_upload = gr.File(
858
  file_types=["image", "pdf", "doc", "docx"],
859
  type="binary",
860
- label="",
861
  elem_classes=["file-upload"]
862
  )
863
 
 
780
  color: white !important;
781
  }
782
 
783
+ /* Style the file upload to be more compact */
784
+ .file-upload {
 
785
  width: 150px !important;
786
+ margin-left: 15px !important;
787
  }
788
 
789
+ /* Hide file preview elements */
790
+ .file-upload .file-preview,
791
+ .file-upload p:not(.file-upload p:first-child),
792
+ .file-upload svg,
793
+ .file-upload [data-testid="chunkFileDropArea"],
794
+ .file-upload .file-drop {
795
  display: none !important;
796
  }
797
 
798
+ /* Style the upload button */
799
+ .file-upload button {
800
  height: 40px !important;
801
+ width: 100% !important;
802
  background-color: #f0f0f0 !important;
803
  border: 1px solid #d9d9d9 !important;
804
  border-radius: 4px !important;
805
+ color: #333 !important;
806
+ font-size: 14px !important;
807
  display: flex !important;
808
  align-items: center !important;
809
  justify-content: center !important;
810
+ margin: 0 !important;
811
  padding: 0 !important;
812
  }
813
 
814
+ /* Hide the "or" text */
815
+ .file-upload .or {
816
  display: none !important;
817
  }
818
 
819
+ /* Make the container compact */
820
+ .file-upload [data-testid="block"] {
821
+ margin: 0 !important;
822
+ padding: 0 !important;
 
 
 
 
 
 
 
 
 
 
823
  }
824
  """
825
 
 
854
  file_upload = gr.File(
855
  file_types=["image", "pdf", "doc", "docx"],
856
  type="binary",
857
+ label="Upload Document",
858
  elem_classes=["file-upload"]
859
  )
860