Jahmori commited on
Commit
f479d1b
·
1 Parent(s): a20fdd7

- removed chunk_length from whisper pipeline for sequential processing

Browse files

- removed generate_kwargs from transcription parameter, already in
default state
- testing whisper chunk timestamp appending

Files changed (1) hide show
  1. app.py +3 -11
app.py CHANGED
@@ -109,7 +109,6 @@ def process_audio(mixture):
109
  feature_extractor=processor.feature_extractor,
110
  dtype=torch_dtype,
111
  device="cuda",
112
- chunk_length_s=30, # Chunks length per audio
113
  )
114
 
115
  print("Whisper model successfully loaded")
@@ -188,24 +187,17 @@ def process_audio(mixture):
188
 
189
  print("Transcribing...")
190
 
191
- generate_kwargs = {
192
- 'task': 'transcribe',
193
- 'language': "english",
194
- "return_timestamps": True
195
- }
196
 
197
- transcriptions ={f"{transcribe(path,generate_kwargs=generate_kwargs,return_timestamps=True)}"}
198
 
199
 
200
  log[speaker_key]["transcriptions"] = transcriptions
201
- if transcriptions["chunks"]:
202
- for chunk in transcription["chunks"]:
203
- full_timestamps.append(chunk)
204
 
205
 
206
 
207
 
208
- # segments = list(transcriptions["chunks"])
209
 
210
 
211
 
 
109
  feature_extractor=processor.feature_extractor,
110
  dtype=torch_dtype,
111
  device="cuda",
 
112
  )
113
 
114
  print("Whisper model successfully loaded")
 
187
 
188
  print("Transcribing...")
189
 
 
 
 
 
 
190
 
191
+ transcriptions ={f"{transcribe(path,return_timestamps=True)}"}
192
 
193
 
194
  log[speaker_key]["transcriptions"] = transcriptions
195
+
196
+ full_timestamps.append(list(transcriptions["chunks"]))
 
197
 
198
 
199
 
200
 
 
201
 
202
 
203