ylacombe HF staff commited on
Commit
cedfb7c
1 Parent(s): b3ebeae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -134,14 +134,14 @@ def yt_transcribe(yt_url, task, use_demucs, dataset_name, oauth_token: gr.OAuthT
134
  with open(filepath, "rb") as f:
135
  inputs_path = f.read()
136
 
137
- inputs = ffmpeg_read(inputs_path, pipe.feature_extractor.sampling_rate)
138
- inputs = {"array": inputs, "sampling_rate": pipe.feature_extractor.sampling_rate}
139
-
140
- out = pipe(inputs, batch_size=BATCH_SIZE, generate_kwargs={"task": task}, return_timestamps=True)
141
 
142
- text = out["text"]
143
 
144
- inputs = ffmpeg_read(inputs_path, dataset_sampling_rate)
 
 
145
 
146
  chunks = naive_postprocess_whisper_chunks(out["chunks"], inputs, dataset_sampling_rate)
147
 
 
134
  with open(filepath, "rb") as f:
135
  inputs_path = f.read()
136
 
137
+ inputs = ffmpeg_read(inputs_path, pipe.feature_extractor.sampling_rate)
138
+ inputs = {"array": inputs, "sampling_rate": pipe.feature_extractor.sampling_rate}
 
 
139
 
140
+ out = pipe(inputs, batch_size=BATCH_SIZE, generate_kwargs={"task": task}, return_timestamps=True)
141
 
142
+ text = out["text"]
143
+
144
+ inputs = ffmpeg_read(inputs_path, dataset_sampling_rate)
145
 
146
  chunks = naive_postprocess_whisper_chunks(out["chunks"], inputs, dataset_sampling_rate)
147