staraks commited on
Commit
bed03fe
·
verified ·
1 Parent(s): 9d046c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +43 -16
app.py CHANGED
@@ -653,25 +653,32 @@ def run_transcription_wrapper(
653
 
654
 
655
  print("DEBUG: building Gradio Blocks", flush=True)
656
- demo = gr.Blocks()
657
 
658
- with demo:
659
- gr.Markdown("## Whisper Transcription (Spaces-ready)")
 
 
 
 
 
 
660
  with gr.Row():
661
- with gr.Column(scale=2):
 
 
662
  file_input = gr.File(
663
- label="Upload audio files (or zip)",
664
  file_count="multiple",
665
  type="filepath",
666
  )
667
  zip_input = gr.File(
668
- label="Optional: Upload zip file containing audio",
669
  file_count="single",
670
  type="filepath",
671
  )
672
  zip_password = gr.Textbox(
673
- label="Zip password (if any)",
674
- placeholder="password (optional)",
675
  )
676
  model_select = gr.Dropdown(
677
  choices=["small", "medium", "large", "base"],
@@ -679,19 +686,39 @@ with demo:
679
  label="Whisper model",
680
  )
681
  merge_checkbox = gr.Checkbox(
682
- label="Merge transcripts to a single .docx (downloadable)",
683
  value=True,
684
  )
685
  memory_checkbox = gr.Checkbox(
686
- label="Enable persistent memory (word/phrase correction)",
687
  value=False,
688
  )
689
- submit = gr.Button("Transcribe")
690
- with gr.Column(scale=3):
691
- logs = gr.Textbox(label="Logs (streaming)", lines=12)
692
- transcripts_out = gr.Textbox(label="Transcripts (streaming)", lines=12)
693
- download_file = gr.File(label="Merged .docx (when enabled)")
694
- progress_num = gr.Number(value=0, label="Progress (%)")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
695
 
696
  submit.click(
697
  fn=run_transcription_wrapper,
 
653
 
654
 
655
  print("DEBUG: building Gradio Blocks", flush=True)
 
656
 
657
+ # ---------- Minimal, easy-to-use UI ----------
658
+ with gr.Blocks(title="Whisper Transcriber") as demo:
659
+ gr.Markdown(
660
+ "## Whisper Transcriber\n"
661
+ "Upload one or more audio files (or a zip) on the left, then click **Transcribe**.\n"
662
+ "Progress, logs, and text output will appear on the right."
663
+ )
664
+
665
  with gr.Row():
666
+ # LEFT: Inputs
667
+ with gr.Column(scale=1):
668
+ gr.Markdown("### Input")
669
  file_input = gr.File(
670
+ label="Audio files",
671
  file_count="multiple",
672
  type="filepath",
673
  )
674
  zip_input = gr.File(
675
+ label="Zip with audio (optional)",
676
  file_count="single",
677
  type="filepath",
678
  )
679
  zip_password = gr.Textbox(
680
+ label="Zip password (optional)",
681
+ placeholder="Leave empty if no password",
682
  )
683
  model_select = gr.Dropdown(
684
  choices=["small", "medium", "large", "base"],
 
686
  label="Whisper model",
687
  )
688
  merge_checkbox = gr.Checkbox(
689
+ label="Merge all transcripts into one .docx",
690
  value=True,
691
  )
692
  memory_checkbox = gr.Checkbox(
693
+ label="Enable correction memory",
694
  value=False,
695
  )
696
+ submit = gr.Button("Transcribe", variant="primary")
697
+
698
+ # RIGHT: Outputs
699
+ with gr.Column(scale=1):
700
+ gr.Markdown("### Output")
701
+ progress_num = gr.Slider(
702
+ minimum=0,
703
+ maximum=100,
704
+ value=0,
705
+ step=1,
706
+ label="Progress (%)",
707
+ interactive=False,
708
+ )
709
+ logs = gr.Textbox(
710
+ label="Logs",
711
+ lines=10,
712
+ interactive=False,
713
+ )
714
+ transcripts_out = gr.Textbox(
715
+ label="Transcript",
716
+ lines=15,
717
+ interactive=False,
718
+ )
719
+ download_file = gr.File(
720
+ label="Merged .docx (when available)"
721
+ )
722
 
723
  submit.click(
724
  fn=run_transcription_wrapper,