davidberenstein1957 HF staff commited on
Commit
96dc279
1 Parent(s): 08fabf7

fix: new gradio version to allow oauth

Browse files
Files changed (3) hide show
  1. app.py +24 -3
  2. requirements.in +1 -2
  3. requirements.txt +1 -2
app.py CHANGED
@@ -240,7 +240,21 @@ with gr.Blocks() as demo:
240
  with gr.Tab():
241
  with gr.Row():
242
  upload_button = gr.File(
243
- file_types=["text"],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
  file_count="multiple",
245
  height=50,
246
  interactive=True,
@@ -249,6 +263,7 @@ with gr.Blocks() as demo:
249
  with gr.Tab():
250
  with gr.Row():
251
  urls = gr.Dataframe(label="URL", headers=["urls"], interactive=True)
 
252
  upload_button_files = gr.Button("Upload URLs")
253
  gr.Markdown("""
254
  ### 2. Adjust Parameters for Chunking Text (Optional)
@@ -291,12 +306,18 @@ with gr.Blocks() as demo:
291
  with gr.Accordion("detailed logs", open=False):
292
  Log(log_file, dark=True, xterm_font_size=12)
293
 
294
- gr.on(
295
- triggers=[upload_button.upload, upload_button_files.click],
296
  inputs=[upload_button, chunk_size, chunk_overlap, split_sentences],
297
  outputs=[state, corpus_preview_df, preview_summary],
298
  )
299
 
 
 
 
 
 
 
300
  update_preview_button.click(
301
  preview_dataset,
302
  inputs=[state, chunk_size, chunk_overlap, split_sentences],
 
240
  with gr.Tab():
241
  with gr.Row():
242
  upload_button = gr.File(
243
+ file_types=[
244
+ ".hwp",
245
+ ".pdf",
246
+ ".docx",
247
+ ".pptx",
248
+ ".ppt",
249
+ ".pptm",
250
+ ".csv",
251
+ ".epub",
252
+ ".md",
253
+ ".mbox",
254
+ ".ipynb",
255
+ ".xls",
256
+ ".xlsx",
257
+ ],
258
  file_count="multiple",
259
  height=50,
260
  interactive=True,
 
263
  with gr.Tab():
264
  with gr.Row():
265
  urls = gr.Dataframe(label="URL", headers=["urls"], interactive=True)
266
+ with gr.Row():
267
  upload_button_files = gr.Button("Upload URLs")
268
  gr.Markdown("""
269
  ### 2. Adjust Parameters for Chunking Text (Optional)
 
306
  with gr.Accordion("detailed logs", open=False):
307
  Log(log_file, dark=True, xterm_font_size=12)
308
 
309
+ upload_button.upload(
310
+ upload_and_preview,
311
  inputs=[upload_button, chunk_size, chunk_overlap, split_sentences],
312
  outputs=[state, corpus_preview_df, preview_summary],
313
  )
314
 
315
+ upload_button_files.click(
316
+ upload_and_preview,
317
+ inputs=[urls, chunk_size, chunk_overlap, split_sentences],
318
+ outputs=[state, corpus_preview_df, preview_summary],
319
+ )
320
+
321
  update_preview_button.click(
322
  preview_dataset,
323
  inputs=[state, chunk_size, chunk_overlap, split_sentences],
requirements.in CHANGED
@@ -1,6 +1,5 @@
1
  datasets
2
- gradio[oauth]<5
3
  gradio_log
4
  llama_index==0.11.22
5
- docling
6
  llama-index-readers-docling
 
1
  datasets
2
+ gradio[oauth]==4.36.1
3
  gradio_log
4
  llama_index==0.11.22
 
5
  llama-index-readers-docling
requirements.txt CHANGED
@@ -1,6 +1,5 @@
1
  datasets
2
- gradio[oauth]<5
3
  gradio_log
4
  llama_index==0.11.22
5
- docling
6
  llama-index-readers-docling
 
1
  datasets
2
+ gradio[oauth]==4.36.1
3
  gradio_log
4
  llama_index==0.11.22
 
5
  llama-index-readers-docling