Anioji commited on
Commit
6bf674d
·
verified ·
1 Parent(s): bc81f54

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -8
app.py CHANGED
@@ -12,14 +12,7 @@ def transcribe(audio_file):
12
  # Transcribe with original Whisper
13
  model = whisper.load_model("large", device)
14
  result = model.transcribe(audio_file)
15
-
16
- # Load alignment model and metadata
17
- model_a, metadata = whisperx.load_align_model(language_code=result["language"], device=device)
18
-
19
- # Align Whisper output
20
- result_aligned = whisperx.align(result["segments"], model_a, metadata, audio_file, device)
21
-
22
- return {"aligned": result_aligned["segments"], "word_segments": result_aligned["word_segments"]}
23
 
24
  inputs = gr.Audio(sources="upload", type="filepath")
25
  outputs = gr.JSON()
 
12
  # Transcribe with original Whisper
13
  model = whisper.load_model("large", device)
14
  result = model.transcribe(audio_file)
15
+ return result
 
 
 
 
 
 
 
16
 
17
  inputs = gr.Audio(sources="upload", type="filepath")
18
  outputs = gr.JSON()