Spaces:
Runtime error
Runtime error
SajjadAyoubi
commited on
Commit
·
be4797d
1
Parent(s):
1d88608
Update app.py
Browse files
app.py
CHANGED
@@ -14,8 +14,8 @@ class Speech2Text:
|
|
14 |
|
15 |
def wav2feature(self, path):
|
16 |
speech_array, sampling_rate = torchaudio.load(path)
|
17 |
-
speech_array = librosa.resample(speech_array.squeeze().numpy(), sampling_rate, processor.feature_extractor.sampling_rate)
|
18 |
-
return processor(speech_array, return_tensors="pt", sampling_rate=processor.feature_extractor.sampling_rate)
|
19 |
|
20 |
def feature2logits(self, features):
|
21 |
with torch.no_grad():
|
|
|
14 |
|
15 |
def wav2feature(self, path):
|
16 |
speech_array, sampling_rate = torchaudio.load(path)
|
17 |
+
speech_array = librosa.resample(speech_array.squeeze().numpy(), sampling_rate, self.processor.feature_extractor.sampling_rate)
|
18 |
+
return processor(speech_array, return_tensors="pt", sampling_rate=self.processor.feature_extractor.sampling_rate)
|
19 |
|
20 |
def feature2logits(self, features):
|
21 |
with torch.no_grad():
|