throaway2854 commited on
Commit
0e85ecd
1 Parent(s): 1e78681

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -416,6 +416,7 @@ with gr.Blocks() as demo:
416
  dataset = datasets[current_dataset_name]
417
  html_content = display_dataset_html(dataset, page_number=0)
418
  entry_options = [f"{idx}: {entry['prompt'][:30]}" for idx, entry in enumerate(dataset)]
 
419
  return gr.update(value=html_content), gr.update(choices=entry_options)
420
 
421
  dataset_selector.change(
@@ -431,6 +432,7 @@ with gr.Blocks() as demo:
431
  dataset = datasets[current_dataset_name]
432
  html_content = display_dataset_html(dataset, page_number=0)
433
  entry_options = [f"{idx}: {entry['prompt'][:30]}" for idx, entry in enumerate(dataset)]
 
434
  return gr.update(value=html_content), gr.update(choices=entry_options)
435
 
436
  add_button.click(
@@ -446,6 +448,7 @@ with gr.Blocks() as demo:
446
  dataset = datasets[current_dataset_name]
447
  html_content = display_dataset_html(dataset, page_number=0)
448
  entry_options = [f"{idx}: {entry['prompt'][:30]}" for idx, entry in enumerate(dataset)]
 
449
  return gr.update(value=html_content), gr.update(choices=entry_options)
450
 
451
  edit_button.click(
@@ -461,6 +464,7 @@ with gr.Blocks() as demo:
461
  dataset = datasets[current_dataset_name]
462
  html_content = display_dataset_html(dataset, page_number=0)
463
  entry_options = [f"{idx}: {entry['prompt'][:30]}" for idx, entry in enumerate(dataset)]
 
464
  return gr.update(value=html_content), gr.update(choices=entry_options)
465
 
466
  delete_button.click(
 
416
  dataset = datasets[current_dataset_name]
417
  html_content = display_dataset_html(dataset, page_number=0)
418
  entry_options = [f"{idx}: {entry['prompt'][:30]}" for idx, entry in enumerate(dataset)]
419
+ dataset_viewer.update(value=html_content) # Update dataset_viewer component
420
  return gr.update(value=html_content), gr.update(choices=entry_options)
421
 
422
  dataset_selector.change(
 
432
  dataset = datasets[current_dataset_name]
433
  html_content = display_dataset_html(dataset, page_number=0)
434
  entry_options = [f"{idx}: {entry['prompt'][:30]}" for idx, entry in enumerate(dataset)]
435
+ dataset_viewer.update(value=html_content) # Update dataset_viewer component
436
  return gr.update(value=html_content), gr.update(choices=entry_options)
437
 
438
  add_button.click(
 
448
  dataset = datasets[current_dataset_name]
449
  html_content = display_dataset_html(dataset, page_number=0)
450
  entry_options = [f"{idx}: {entry['prompt'][:30]}" for idx, entry in enumerate(dataset)]
451
+ dataset_viewer.update(value=html_content) # Update dataset_viewer component
452
  return gr.update(value=html_content), gr.update(choices=entry_options)
453
 
454
  edit_button.click(
 
464
  dataset = datasets[current_dataset_name]
465
  html_content = display_dataset_html(dataset, page_number=0)
466
  entry_options = [f"{idx}: {entry['prompt'][:30]}" for idx, entry in enumerate(dataset)]
467
+ dataset_viewer.update(value=html_content) # Update dataset_viewer component
468
  return gr.update(value=html_content), gr.update(choices=entry_options)
469
 
470
  delete_button.click(