SuveenE commited on
Commit
cdb0177
Β·
1 Parent(s): 9e3db2b
Files changed (1) hide show
  1. app.py +62 -63
app.py CHANGED
@@ -1,12 +1,11 @@
1
  import os
2
- import sys
3
  import threading
4
  import queue
5
  import time
6
  import tempfile
7
  import shutil
8
  from contextlib import redirect_stdout, redirect_stderr
9
- from typing import List, Optional
10
 
11
  import gradio as gr
12
  from huggingface_hub import HfApi
@@ -189,67 +188,67 @@ with gr.Blocks(title="LeRobot Episode Deleter", theme=gr.themes.Soft()) as demo:
189
  "Delete specific episodes from a HuggingFace LeRobot dataset and upload the cleaned version."
190
  )
191
 
192
- with gr.Tabs():
193
- with gr.Tab("Step 1: Select Dataset"):
194
- with gr.Row():
195
- with gr.Column(scale=3):
196
- search_box = gr.Textbox(
197
- label="Search Datasets",
198
- placeholder="Enter keyword or organization name (e.g., 'lerobot', 'griffinlabs-cortex')",
199
- value="griffinlabs-cortex"
200
- )
201
- with gr.Column(scale=1):
202
- search_btn = gr.Button("πŸ” Search", variant="primary")
203
-
204
- dataset_dropdown = gr.Dropdown(
205
- label="Available Datasets",
206
- choices=search_datasets_fn("griffinlabs-cortex"),
207
- interactive=True,
208
- allow_custom_value=True,
209
- )
210
-
211
- with gr.Row():
212
- download_btn = gr.Button("πŸ“₯ Download & List Episodes", variant="secondary", size="lg")
213
-
214
- download_status = gr.Textbox(
215
- label="Download Status",
216
- lines=2,
217
- interactive=False,
218
- )
219
-
220
- with gr.Tab("Step 2: Select Episodes to Delete"):
221
- gr.Markdown("Select the episodes you want to **remove** from the dataset.")
222
-
223
- episodes_selector = gr.CheckboxGroup(
224
- label="Episodes (select to delete)",
225
- choices=[],
226
- interactive=True,
227
- )
228
-
229
- selected_count = gr.Markdown("*No episodes selected*")
230
-
231
- with gr.Tab("Step 3: Delete & Upload"):
232
- gr.Markdown("Configure the destination and start the deletion process.")
233
-
234
- dest_repo_input = gr.Textbox(
235
- label="Destination Repository ID",
236
- placeholder="your-org/cleaned-dataset",
237
- info="The HuggingFace repo where the cleaned dataset will be uploaded"
238
- )
239
-
240
- with gr.Row():
241
- execute_btn = gr.Button(
242
- "πŸš€ Delete Episodes & Upload",
243
- variant="primary",
244
- size="lg",
245
- )
246
-
247
- progress_log = gr.Textbox(
248
- label="Progress Log",
249
- lines=25,
250
- interactive=False,
251
- max_lines=30,
252
- )
253
 
254
  # Event handlers
255
  def update_search_results(query):
 
1
  import os
 
2
  import threading
3
  import queue
4
  import time
5
  import tempfile
6
  import shutil
7
  from contextlib import redirect_stdout, redirect_stderr
8
+ from typing import List
9
 
10
  import gradio as gr
11
  from huggingface_hub import HfApi
 
188
  "Delete specific episodes from a HuggingFace LeRobot dataset and upload the cleaned version."
189
  )
190
 
191
+ # Load initial datasets
192
+ _initial_choices = search_datasets_fn("griffinlabs-cortex")
193
+
194
+ with gr.Row():
195
+ search_box = gr.Textbox(
196
+ label="Search Datasets (optional)",
197
+ placeholder="Enter keyword or organization name (e.g., 'lerobot', 'griffinlabs-cortex')",
198
+ value="griffinlabs-cortex"
199
+ )
200
+ search_btn = gr.Button("πŸ” Search")
201
+
202
+ with gr.Row():
203
+ dataset_dropdown = gr.Dropdown(
204
+ label="Select Dataset",
205
+ choices=_initial_choices,
206
+ interactive=True,
207
+ allow_custom_value=True,
208
+ )
209
+
210
+ with gr.Row():
211
+ download_btn = gr.Button("πŸ“₯ Download & List Episodes", variant="secondary", size="lg")
212
+
213
+ download_status = gr.Textbox(
214
+ label="Status",
215
+ lines=2,
216
+ interactive=False,
217
+ )
218
+
219
+ gr.Markdown("---")
220
+ gr.Markdown("### Select Episodes to Delete")
221
+
222
+ episodes_selector = gr.CheckboxGroup(
223
+ label="Episodes (select to delete)",
224
+ choices=[],
225
+ interactive=True,
226
+ )
227
+
228
+ selected_count = gr.Markdown("*No episodes selected*")
229
+
230
+ gr.Markdown("---")
231
+ gr.Markdown("### Configure Destination & Execute")
232
+
233
+ dest_repo_input = gr.Textbox(
234
+ label="Destination Repository ID",
235
+ placeholder="your-org/cleaned-dataset",
236
+ info="The HuggingFace repo where the cleaned dataset will be uploaded"
237
+ )
238
+
239
+ with gr.Row():
240
+ execute_btn = gr.Button(
241
+ "πŸš€ Delete Episodes & Upload",
242
+ variant="primary",
243
+ size="lg",
244
+ )
245
+
246
+ progress_log = gr.Textbox(
247
+ label="Progress Log",
248
+ lines=20,
249
+ interactive=False,
250
+ max_lines=25,
251
+ )
252
 
253
  # Event handlers
254
  def update_search_results(query):