File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,9 @@ def single_job(utt):
26
26
if sample_rate != 16000 :
27
27
audio = torchaudio .transforms .Resample (orig_freq = sample_rate , new_freq = 16000 )(audio )
28
28
feat = kaldi .fbank (audio ,
29
- num_mel_bins = 80 ,
30
- dither = 0 ,
31
- sample_frequency = 16000 )
29
+ num_mel_bins = 80 ,
30
+ dither = 0 ,
31
+ sample_frequency = 16000 )
32
32
feat = feat - feat .mean (dim = 0 , keepdim = True )
33
33
embedding = ort_session .run (None , {ort_session .get_inputs ()[0 ].name : feat .unsqueeze (dim = 0 ).cpu ().numpy ()})[0 ].flatten ().tolist ()
34
34
return utt , embedding
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ def single_job(utt):
33
33
else :
34
34
feat = whisper .log_mel_spectrogram (audio , n_mels = 128 )
35
35
speech_token = ort_session .run (None , {ort_session .get_inputs ()[0 ].name : feat .detach ().cpu ().numpy (),
36
- ort_session .get_inputs ()[1 ].name : np .array ([feat .shape [2 ]], dtype = np .int32 )})[0 ].flatten ().tolist ()
36
+ ort_session .get_inputs ()[1 ].name : np .array ([feat .shape [2 ]], dtype = np .int32 )})[0 ].flatten ().tolist ()
37
37
return utt , speech_token
38
38
39
39
You can’t perform that action at this time.
0 commit comments