Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -137,6 +137,15 @@ def get_transcribe_state(segments):
|
|
137 |
|
138 |
@spaces.GPU(duration=60)
|
139 |
def transcribe(seed, audio_path):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
if transcribe_model is None:
|
141 |
raise gr.Error("Transcription model not loaded")
|
142 |
seed_everything(seed)
|
@@ -454,18 +463,6 @@ def update_demo(mode, smart_transcript, edit_word_mode, transcript, edit_from_wo
|
|
454 |
|
455 |
def get_app():
|
456 |
with gr.Blocks() as app:
|
457 |
-
with gr.Row():
|
458 |
-
with gr.Column(scale=2):
|
459 |
-
load_models_btn = gr.Button(value="Load models")
|
460 |
-
with gr.Column(scale=5):
|
461 |
-
with gr.Accordion("Select models", open=False) as models_selector:
|
462 |
-
with gr.Row():
|
463 |
-
voicecraft_model_choice = gr.Radio(label="VoiceCraft model", value="830M_TTSEnhanced",
|
464 |
-
choices=["330M", "830M", "330M_TTSEnhanced", "830M_TTSEnhanced"])
|
465 |
-
whisper_backend_choice = gr.Radio(label="Whisper backend", value="whisperX", choices=["whisperX", "whisper"])
|
466 |
-
whisper_model_choice = gr.Radio(label="Whisper model", value="base.en",
|
467 |
-
choices=[None, "base.en", "small.en", "medium.en", "large"])
|
468 |
-
align_model_choice = gr.Radio(label="Forced alignment model", value="whisperX", choices=["whisperX", None])
|
469 |
|
470 |
with gr.Row():
|
471 |
with gr.Column(scale=2):
|
|
|
137 |
|
138 |
@spaces.GPU(duration=60)
|
139 |
def transcribe(seed, audio_path):
|
140 |
+
# first, create your aligner
|
141 |
+
aligner = WhisperxAlignModel()
|
142 |
+
|
143 |
+
# then load the ASR+alignment combo
|
144 |
+
transcribe_model = WhisperxModel(
|
145 |
+
model_name="large.en", # or "base.en", "small.en", etc.
|
146 |
+
align_model=aligner
|
147 |
+
)
|
148 |
+
|
149 |
if transcribe_model is None:
|
150 |
raise gr.Error("Transcription model not loaded")
|
151 |
seed_everything(seed)
|
|
|
463 |
|
464 |
def get_app():
|
465 |
with gr.Blocks() as app:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
466 |
|
467 |
with gr.Row():
|
468 |
with gr.Column(scale=2):
|