Spaces:
Runtime error
Runtime error
SajjadAyoubi
commited on
Commit
•
036a5a5
1
Parent(s):
be4797d
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ class Speech2Text:
|
|
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():
|
|
|
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 self.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():
|