Update app.py
Browse files
app.py
CHANGED
@@ -780,46 +780,49 @@ def create_interface():
|
|
780 |
color: white !important;
|
781 |
}
|
782 |
|
783 |
-
/* Styling for
|
784 |
-
.
|
785 |
margin-left: 15px;
|
786 |
}
|
787 |
|
788 |
-
/* Hide file upload
|
789 |
-
.
|
790 |
display: none !important;
|
791 |
}
|
792 |
|
793 |
-
/*
|
794 |
-
.
|
795 |
display: none !important;
|
796 |
}
|
797 |
|
798 |
-
/*
|
799 |
-
.
|
800 |
-
|
|
|
|
|
|
|
|
|
|
|
801 |
padding: 0 15px !important;
|
802 |
background-color: #f0f0f0 !important;
|
803 |
border: 1px solid #d9d9d9 !important;
|
804 |
border-radius: 4px !important;
|
805 |
-
|
|
|
|
|
806 |
}
|
807 |
|
808 |
-
/* Style the
|
809 |
-
.
|
810 |
font-size: 14px !important;
|
811 |
font-weight: normal !important;
|
|
|
812 |
}
|
813 |
|
814 |
/* Hover effect */
|
815 |
-
.
|
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,26 +843,24 @@ def create_interface():
|
|
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 |
-
#
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
show_label=False
|
852 |
-
)
|
853 |
|
854 |
-
#
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
)
|
863 |
|
864 |
# Analyze button
|
865 |
analyze_btn = gr.Button("Analyze Text", elem_id="analyze-btn")
|
|
|
780 |
color: white !important;
|
781 |
}
|
782 |
|
783 |
+
/* Styling for file upload button */
|
784 |
+
.file-uploader {
|
785 |
margin-left: 15px;
|
786 |
}
|
787 |
|
788 |
+
/* Hide the standard file upload appearance */
|
789 |
+
.file-uploader .file-preview {
|
790 |
display: none !important;
|
791 |
}
|
792 |
|
793 |
+
/* Hide the drop area text */
|
794 |
+
.file-uploader .file-drop {
|
795 |
display: none !important;
|
796 |
}
|
797 |
|
798 |
+
/* Hide the "or" text */
|
799 |
+
.file-uploader p {
|
800 |
+
display: none !important;
|
801 |
+
}
|
802 |
+
|
803 |
+
/* Style the actual button */
|
804 |
+
.file-uploader > div:last-child {
|
805 |
+
height: 40px !important;
|
806 |
padding: 0 15px !important;
|
807 |
background-color: #f0f0f0 !important;
|
808 |
border: 1px solid #d9d9d9 !important;
|
809 |
border-radius: 4px !important;
|
810 |
+
display: flex !important;
|
811 |
+
align-items: center !important;
|
812 |
+
justify-content: center !important;
|
813 |
}
|
814 |
|
815 |
+
/* Style the button text */
|
816 |
+
.file-uploader label span {
|
817 |
font-size: 14px !important;
|
818 |
font-weight: normal !important;
|
819 |
+
margin: 0 !important;
|
820 |
}
|
821 |
|
822 |
/* Hover effect */
|
823 |
+
.file-uploader > div:last-child:hover {
|
824 |
background-color: #e0e0e0 !important;
|
825 |
}
|
|
|
|
|
|
|
|
|
|
|
826 |
"""
|
827 |
|
828 |
with gr.Blocks(css=css, title="AI Text Detector") as demo:
|
|
|
843 |
gr.Markdown("Analysis Mode")
|
844 |
gr.Markdown("Quick mode for faster analysis. Detailed mode for sentence-level analysis.")
|
845 |
|
846 |
+
# Create a row for radio buttons and upload button
|
847 |
with gr.Row():
|
848 |
+
# Radio buttons for analysis mode
|
849 |
+
mode_selection = gr.Radio(
|
850 |
+
choices=["quick", "detailed"],
|
851 |
+
value="quick",
|
852 |
+
label="",
|
853 |
+
show_label=False
|
854 |
+
)
|
|
|
|
|
855 |
|
856 |
+
# File upload component
|
857 |
+
file_upload = gr.File(
|
858 |
+
file_types=["image", "pdf", "doc", "docx"],
|
859 |
+
type="binary",
|
860 |
+
label="Upload Document",
|
861 |
+
elem_classes=["file-uploader"],
|
862 |
+
interactive=True
|
863 |
+
)
|
|
|
864 |
|
865 |
# Analyze button
|
866 |
analyze_btn = gr.Button("Analyze Text", elem_id="analyze-btn")
|