Ayushnangia commited on
Commit
6bb4d3b
·
1 Parent(s): e0d76cb

new examples

Browse files
Files changed (1) hide show
  1. app.py +13 -8
app.py CHANGED
@@ -352,6 +352,16 @@ with gr.Blocks() as rag_interface:
352
  # File upload and ingest
353
  file_input = gr.File(label="Upload File to Ingest")
354
  add_file_button = gr.Button("Ingest File")
 
 
 
 
 
 
 
 
 
 
355
  gr.Examples(
356
  examples=[
357
  ["Examples/RESULT_OCR.txt"],
@@ -359,17 +369,12 @@ with gr.Blocks() as rag_interface:
359
  ["Examples/RESULT_OCR_3.txt"]
360
  ],
361
  inputs=file_input,
 
 
 
362
  label="Example Files"
363
  )
364
 
365
- # Scrollable list for ingested files
366
- ingested_files_box = gr.Dataframe(
367
- headers=["Files"],
368
- datatype="str",
369
- row_count=4, # Limits the visible rows to create a scrollable view
370
- interactive=False
371
- )
372
-
373
  # Radio buttons to choose delete option
374
  delete_option = gr.Radio(choices=["Delete by File Name", "Delete All Files"], label="Delete Option")
375
  file_name_input = gr.Textbox(label="Enter File Name to Delete", visible=False)
 
352
  # File upload and ingest
353
  file_input = gr.File(label="Upload File to Ingest")
354
  add_file_button = gr.Button("Ingest File")
355
+
356
+ # Add examples for file upload with proper function and outputs
357
+
358
+ # Scrollable list for ingested files
359
+ ingested_files_box = gr.Dataframe(
360
+ headers=["Files"],
361
+ datatype="str",
362
+ row_count=4, # Limits the visible rows to create a scrollable view
363
+ interactive=False
364
+ )
365
  gr.Examples(
366
  examples=[
367
  ["Examples/RESULT_OCR.txt"],
 
369
  ["Examples/RESULT_OCR_3.txt"]
370
  ],
371
  inputs=file_input,
372
+ outputs=ingested_files_box,
373
+ fn=data_obj.add_file,
374
+ cache_examples=True,
375
  label="Example Files"
376
  )
377
 
 
 
 
 
 
 
 
 
378
  # Radio buttons to choose delete option
379
  delete_option = gr.Radio(choices=["Delete by File Name", "Delete All Files"], label="Delete Option")
380
  file_name_input = gr.Textbox(label="Enter File Name to Delete", visible=False)