romsyflux commited on
Commit
ba7591a
1 Parent(s): 859b594

Revert test removing waveform_tensor and using data as input

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -200,14 +200,15 @@ def align_timestamps(segments, dia_seg_last_end):
200
 
201
  def transcribe_diarize(audio):
202
  sr, data = audio
203
- #processed_data = np.array(data).astype(np.float32) / 32767.0
204
- #waveform_tensor = torch.tensor(processed_data[np.newaxis, :])
 
205
 
206
  transcription_res = transcribe(sr, data)
207
  # results from the diarization pipeline
208
  diarization_res = diarization_pipeline(
209
  #Test directly with processed_data {"waveform": waveform_tensor, "sample_rate": sr}
210
- {"waveform": data, "sample_rate": sr}
211
  )
212
  dia_seg, dia_label = [], []
213
  for segment, _, label in diarization_res.itertracks(yield_label=True):
 
200
 
201
  def transcribe_diarize(audio):
202
  sr, data = audio
203
+ print(sr)
204
+ processed_data = np.array(data).astype(np.float32) / 32767.0
205
+ waveform_tensor = torch.tensor(processed_data[np.newaxis, :])
206
 
207
  transcription_res = transcribe(sr, data)
208
  # results from the diarization pipeline
209
  diarization_res = diarization_pipeline(
210
  #Test directly with processed_data {"waveform": waveform_tensor, "sample_rate": sr}
211
+ {"waveform": waveform_tensor, "sample_rate": sr}
212
  )
213
  dia_seg, dia_label = [], []
214
  for segment, _, label in diarization_res.itertracks(yield_label=True):