Nihal2000 commited on
Commit
2d815ec
Β·
1 Parent(s): 8ca5ec3

updated ui

Browse files
Files changed (1) hide show
  1. app.py +58 -26
app.py CHANGED
@@ -1131,33 +1131,65 @@ def create_gradio_interface():
1131
 
1132
  with gr.Tab("πŸ“„ Upload Documents"):
1133
  gr.Markdown("""
1134
- **Supported Formats:**
1135
- - πŸ“„ **PDF**: Research papers, reports, books
1136
- - πŸ“ **Word (DOCX)**: Documents, manuscripts
1137
- - πŸ“ƒ **Text (TXT)**: Plain text files, code
1138
- - πŸ–ΌοΈ **Images (JPG/PNG)**: Screenshots, scanned documents (OCR enabled)
1139
-
1140
- **Best Practices:**
1141
- - Upload related documents together for better context
1142
- - Larger documents may take 30-60 seconds to process
1143
- - Images will be processed with OCR automatically
1144
- - Each document gets unique tags and embeddings
1145
 
1146
- **Example Use Cases:**
1147
- - Upload research papers β†’ Ask questions across all papers
1148
- - Upload meeting notes β†’ Generate summary podcasts
1149
- - Upload technical docs β†’ Get explanations for concepts
1150
- """)
1151
-
1152
- with gr.Row():
1153
- with gr.Column():
1154
- gr.Markdown("### Add Documents to Your Library")
1155
- file_input_upload = gr.File(label="Select Document to Upload", file_types=[".pdf", ".txt", ".docx", ".png", ".jpg", ".jpeg"], type="filepath")
1156
- upload_btn_process = gr.Button("πŸš€ Process & Add to Library", variant="primary", size="lg")
1157
- with gr.Column():
1158
- upload_output_display = gr.Textbox(label="Processing Result", lines=6, placeholder="Upload a document to see processing results...")
1159
- doc_id_output_display = gr.Textbox(label="Document ID", placeholder="Document ID will appear here after processing...")
1160
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1161
 
1162
  with gr.Tab("πŸ“ Content Studio"):
1163
  gr.Markdown("""
 
1131
 
1132
  with gr.Tab("πŸ“„ Upload Documents"):
1133
  gr.Markdown("""
1134
+ ### πŸ“ Upload & Process Documents
1135
+
1136
+ Upload PDFs, DOCX, TXT or Images. OCR runs automatically.
1137
+ Once processed, the document becomes searchable and available for summaries, tagging, podcasting and RAG.
1138
+ """)
1139
+
1140
+ with gr.Row(equal_height=True):
 
 
 
 
1141
 
1142
+ # LEFT SIDE: UPLOAD PANEL
1143
+ with gr.Column(scale=1):
1144
+ with gr.Group():
1145
+ gr.Markdown("#### πŸ“€ Upload File")
1146
+
1147
+ file_input_upload = gr.File(
1148
+ label="Select a document",
1149
+ file_types=[".pdf", ".txt", ".docx", ".png", ".jpg", ".jpeg"],
1150
+ type="filepath"
1151
+ )
1152
+
1153
+ gr.HTML("<div style='height:10px'></div>") # spacing
1154
+
1155
+ upload_btn_process = gr.Button(
1156
+ "πŸš€ Process & Add to Library",
1157
+ variant="primary",
1158
+ size="lg",
1159
+ elem_id="upload-btn"
1160
+ )
1161
+
1162
+ # RIGHT SIDE: STATUS PANEL
1163
+ with gr.Column(scale=1):
1164
+ with gr.Group():
1165
+ gr.Markdown("#### πŸ“¦ Processing Preview")
1166
+
1167
+ upload_output_display = gr.Textbox(
1168
+ label="Processing Status",
1169
+ placeholder="⏳ Waiting for upload...",
1170
+ lines=10,
1171
+ interactive=False,
1172
+ )
1173
+
1174
+ doc_id_output_display = gr.Textbox(
1175
+ label="πŸ“Œ Document ID",
1176
+ placeholder="Will appear after processing...",
1177
+ interactive=False
1178
+ )
1179
+
1180
+
1181
+ # Optional: center button styling
1182
+ gr.HTML("""
1183
+ <style>
1184
+ #upload-btn button {
1185
+ width: 100%;
1186
+ font-size: 18px;
1187
+ padding: 14px;
1188
+ }
1189
+ </style>
1190
+ """)
1191
+
1192
+
1193
 
1194
  with gr.Tab("πŸ“ Content Studio"):
1195
  gr.Markdown("""