kerojohan commited on
Commit
8057fce
·
1 Parent(s): 6c4bb6f

Remove extra example controls from Space UI

Browse files
Files changed (1) hide show
  1. app.py +2 -43
app.py CHANGED
@@ -101,13 +101,6 @@ def _build_examples_table_html() -> str:
101
  </div>
102
  """
103
  )
104
-
105
-
106
- def load_example(example_idx: int) -> tuple[str, str, str]:
107
- example = EXAMPLE_VIDEOS[example_idx]
108
- return example["url"], example["size"], example["duration"]
109
-
110
-
111
  def _prepare_config(config_file: str | None, work_dir: Path) -> Path:
112
  source_path = Path(config_file) if config_file else DEFAULT_CONFIG_PATH
113
  if not source_path.exists():
@@ -334,19 +327,12 @@ APP_CSS = """
334
  max-width: 220px;
335
  }
336
 
337
- .examples-table-shell {
338
- overflow-x: auto;
339
- border: 1px solid #d7d0c3;
340
- border-radius: 12px;
341
- background: #fffdf8;
342
- margin: 10px 0 14px;
343
- }
344
-
345
  .examples-table {
346
  width: 100%;
347
  border-collapse: collapse;
348
  font-size: 0.95rem;
349
  color: #2a231c;
 
350
  }
351
 
352
  .examples-table th,
@@ -384,10 +370,6 @@ APP_CSS = """
384
  background: #1b1510;
385
  }
386
 
387
- .example-buttons {
388
- gap: 10px;
389
- }
390
-
391
  .config-note,
392
  .config-note * {
393
  color: #4a4238 !important;
@@ -436,17 +418,6 @@ with gr.Blocks(title=APP_TITLE) as demo:
436
  "Si no subes configuración, se usará `config.out3_clean.yaml`.",
437
  elem_classes=["config-note"],
438
  )
439
- example_file_size = gr.Textbox(
440
- label="Peso (original)",
441
- interactive=False,
442
- visible=False,
443
- )
444
- example_duration = gr.Textbox(
445
- label="Duración",
446
- interactive=False,
447
- visible=False,
448
- )
449
-
450
  with gr.Column(scale=1, elem_classes=["panel"]):
451
  gr.HTML('<div class="section-kicker">Resumen</div>')
452
  summary_output = gr.Textbox(
@@ -486,23 +457,11 @@ with gr.Blocks(title=APP_TITLE) as demo:
486
  with gr.Column(elem_classes=["examples-footer"]):
487
  gr.Markdown(
488
  "### Ejemplos de vídeo\n"
489
- "Consulta la tabla con miniaturas y usa un botón para cargar ese vídeo en **Video de entrada**. "
490
  "**Peso** y **duración** corresponden al archivo original en el bucket. "
491
  "El segundo ejemplo es muy grande y puede tardar en descargarse."
492
  )
493
  gr.HTML(_build_examples_table_html())
494
- with gr.Row(elem_classes=["example-buttons"]):
495
- example_rabella_button = gr.Button("Cargar Rabella")
496
- example_provagran2_button = gr.Button("Cargar Provagran2")
497
-
498
- example_rabella_button.click(
499
- fn=lambda: load_example(0),
500
- outputs=[video_input, example_file_size, example_duration],
501
- )
502
- example_provagran2_button.click(
503
- fn=lambda: load_example(1),
504
- outputs=[video_input, example_file_size, example_duration],
505
- )
506
 
507
  run_button.click(
508
  fn=process_video,
 
101
  </div>
102
  """
103
  )
 
 
 
 
 
 
 
104
  def _prepare_config(config_file: str | None, work_dir: Path) -> Path:
105
  source_path = Path(config_file) if config_file else DEFAULT_CONFIG_PATH
106
  if not source_path.exists():
 
327
  max-width: 220px;
328
  }
329
 
 
 
 
 
 
 
 
 
330
  .examples-table {
331
  width: 100%;
332
  border-collapse: collapse;
333
  font-size: 0.95rem;
334
  color: #2a231c;
335
+ margin-top: 10px;
336
  }
337
 
338
  .examples-table th,
 
370
  background: #1b1510;
371
  }
372
 
 
 
 
 
373
  .config-note,
374
  .config-note * {
375
  color: #4a4238 !important;
 
418
  "Si no subes configuración, se usará `config.out3_clean.yaml`.",
419
  elem_classes=["config-note"],
420
  )
 
 
 
 
 
 
 
 
 
 
 
421
  with gr.Column(scale=1, elem_classes=["panel"]):
422
  gr.HTML('<div class="section-kicker">Resumen</div>')
423
  summary_output = gr.Textbox(
 
457
  with gr.Column(elem_classes=["examples-footer"]):
458
  gr.Markdown(
459
  "### Ejemplos de vídeo\n"
460
+ "La tabla muestra una miniatura de cada vídeo. "
461
  "**Peso** y **duración** corresponden al archivo original en el bucket. "
462
  "El segundo ejemplo es muy grande y puede tardar en descargarse."
463
  )
464
  gr.HTML(_build_examples_table_html())
 
 
 
 
 
 
 
 
 
 
 
 
465
 
466
  run_button.click(
467
  fn=process_video,