luisoala commited on
Commit
0953dd4
·
1 Parent(s): e05a9c7

wait and see

Browse files
Files changed (1) hide show
  1. app.py +24 -17
app.py CHANGED
@@ -319,22 +319,6 @@ def create_ui():
319
  None # report_md
320
  ]
321
 
322
- # Show progress indicator
323
- progress_html = """
324
- <div class="validation-progress">
325
- <div class="loading-spinner"></div>
326
- <span>Validating file...</span>
327
- </div>
328
- """
329
-
330
- yield [
331
- gr.update(visible=False), # validation_results
332
- gr.update(visible=True, value=progress_html), # validation_progress
333
- gr.update(visible=False), # report_group
334
- None, # report_text
335
- None # report_md
336
- ]
337
-
338
  # Process the file and get results
339
  results, report = process_file(file)
340
 
@@ -368,11 +352,34 @@ def create_ui():
368
  inputs=file_input,
369
  outputs=[upload_progress, validation_results]
370
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
371
  validate_btn.click(
372
- on_validate,
 
 
 
 
 
373
  inputs=file_input,
374
  outputs=[validation_results, validation_progress, report_group, report_text, report_md]
375
  )
 
376
  fetch_btn.click(
377
  fetch_from_url,
378
  inputs=url_input,
 
319
  None # report_md
320
  ]
321
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
322
  # Process the file and get results
323
  results, report = process_file(file)
324
 
 
352
  inputs=file_input,
353
  outputs=[upload_progress, validation_results]
354
  )
355
+
356
+ # Add progress state handling
357
+ def show_progress():
358
+ progress_html = """
359
+ <div class="validation-progress">
360
+ <div class="loading-spinner"></div>
361
+ <span>Validating file...</span>
362
+ </div>
363
+ """
364
+ return [
365
+ gr.update(visible=False), # validation_results
366
+ gr.update(visible=True, value=progress_html), # validation_progress
367
+ gr.update(visible=False), # report_group
368
+ None, # report_text
369
+ None # report_md
370
+ ]
371
+
372
  validate_btn.click(
373
+ fn=show_progress,
374
+ inputs=None,
375
+ outputs=[validation_results, validation_progress, report_group, report_text, report_md],
376
+ queue=False
377
+ ).then(
378
+ fn=on_validate,
379
  inputs=file_input,
380
  outputs=[validation_results, validation_progress, report_group, report_text, report_md]
381
  )
382
+
383
  fetch_btn.click(
384
  fetch_from_url,
385
  inputs=url_input,