Update app.py
Browse files
app.py
CHANGED
@@ -790,6 +790,11 @@ def create_interface():
|
|
790 |
display: none !important;
|
791 |
}
|
792 |
|
|
|
|
|
|
|
|
|
|
|
793 |
/* Style the file upload button to look like our desired Upload Document button */
|
794 |
.custom-file-upload > div:last-child {
|
795 |
height: 38px !important;
|
@@ -797,6 +802,7 @@ def create_interface():
|
|
797 |
background-color: #f0f0f0 !important;
|
798 |
border: 1px solid #d9d9d9 !important;
|
799 |
border-radius: 4px !important;
|
|
|
800 |
}
|
801 |
|
802 |
/* Style the upload button text */
|
@@ -809,6 +815,11 @@ def create_interface():
|
|
809 |
.custom-file-upload > div:last-child:hover {
|
810 |
background-color: #e0e0e0 !important;
|
811 |
}
|
|
|
|
|
|
|
|
|
|
|
812 |
"""
|
813 |
|
814 |
with gr.Blocks(css=css, title="AI Text Detector") as demo:
|
@@ -829,23 +840,26 @@ def create_interface():
|
|
829 |
gr.Markdown("Analysis Mode")
|
830 |
gr.Markdown("Quick mode for faster analysis. Detailed mode for sentence-level analysis.")
|
831 |
|
832 |
-
# Create a row for radio buttons and upload button
|
833 |
with gr.Row():
|
834 |
-
#
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
# Custom styled file upload component
|
843 |
-
with gr.Column(elem_classes=["custom-file-upload"], scale=0, min_width=150):
|
844 |
-
file_upload = gr.File(
|
845 |
-
file_types=["image", "pdf", "doc", "docx"],
|
846 |
-
type="binary",
|
847 |
-
label="Upload Document"
|
848 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
849 |
|
850 |
# Analyze button
|
851 |
analyze_btn = gr.Button("Analyze Text", elem_id="analyze-btn")
|
|
|
790 |
display: none !important;
|
791 |
}
|
792 |
|
793 |
+
/* Remove the "or" text in the file upload component */
|
794 |
+
.custom-file-upload .file-preview + p {
|
795 |
+
display: none !important;
|
796 |
+
}
|
797 |
+
|
798 |
/* Style the file upload button to look like our desired Upload Document button */
|
799 |
.custom-file-upload > div:last-child {
|
800 |
height: 38px !important;
|
|
|
802 |
background-color: #f0f0f0 !important;
|
803 |
border: 1px solid #d9d9d9 !important;
|
804 |
border-radius: 4px !important;
|
805 |
+
width: 100% !important;
|
806 |
}
|
807 |
|
808 |
/* Style the upload button text */
|
|
|
815 |
.custom-file-upload > div:last-child:hover {
|
816 |
background-color: #e0e0e0 !important;
|
817 |
}
|
818 |
+
|
819 |
+
/* Align the button container width with radio buttons */
|
820 |
+
.button-container {
|
821 |
+
width: 184px !important;
|
822 |
+
}
|
823 |
"""
|
824 |
|
825 |
with gr.Blocks(css=css, title="AI Text Detector") as demo:
|
|
|
840 |
gr.Markdown("Analysis Mode")
|
841 |
gr.Markdown("Quick mode for faster analysis. Detailed mode for sentence-level analysis.")
|
842 |
|
|
|
843 |
with gr.Row():
|
844 |
+
# Column for radio buttons
|
845 |
+
with gr.Column(scale=0):
|
846 |
+
# Radio buttons for analysis mode
|
847 |
+
mode_selection = gr.Radio(
|
848 |
+
choices=["quick", "detailed"],
|
849 |
+
value="quick",
|
850 |
+
label="",
|
851 |
+
show_label=False
|
|
|
|
|
|
|
|
|
|
|
|
|
852 |
)
|
853 |
+
|
854 |
+
# Column for upload button with fixed width to match radio buttons
|
855 |
+
with gr.Column(elem_classes=["button-container"], scale=0):
|
856 |
+
# Custom styled file upload component
|
857 |
+
with gr.Column(elem_classes=["custom-file-upload"], scale=0):
|
858 |
+
file_upload = gr.File(
|
859 |
+
file_types=["image", "pdf", "doc", "docx"],
|
860 |
+
type="binary",
|
861 |
+
label="Upload Document"
|
862 |
+
)
|
863 |
|
864 |
# Analyze button
|
865 |
analyze_btn = gr.Button("Analyze Text", elem_id="analyze-btn")
|