throaway2854 commited on
Commit
a43b1eb
·
verified ·
1 Parent(s): 71ba4cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -214,8 +214,9 @@ with gr.Blocks() as demo:
214
  img_data = f"data:image/png;base64,{img_str}"
215
  datasets[current_dataset_name].append({'image': img_data, 'prompt': prompt})
216
  dataset = datasets[current_dataset_name]
217
- # Reset page number to 0 when a new entry is added
218
  page_number = 0
 
219
  html_content = display_dataset_html(dataset, page_number=page_number)
220
  return datasets, page_number, gr.update(value=html_content), f"Entry added to dataset '{current_dataset_name}'."
221
 
 
214
  img_data = f"data:image/png;base64,{img_str}"
215
  datasets[current_dataset_name].append({'image': img_data, 'prompt': prompt})
216
  dataset = datasets[current_dataset_name]
217
+ # Reset page number to 0 and refresh HTML
218
  page_number = 0
219
+ dataset = datasets[current_dataset_name]
220
  html_content = display_dataset_html(dataset, page_number=page_number)
221
  return datasets, page_number, gr.update(value=html_content), f"Entry added to dataset '{current_dataset_name}'."
222