SajjadAyoubi commited on
Commit
352eab8
1 Parent(s): 1d629c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -19,8 +19,7 @@ class Speech2Text:
19
 
20
  def feature2logits(self, features):
21
  with torch.no_grad():
22
- return wav2vec_model(features.input_values.to(device),
23
- attention_mask=features.attention_mask.to(device)).logits.numpy()[0]
24
 
25
  def __call__(self, path):
26
  logits = self.feature2logits(self.wav2feature(path))
@@ -34,6 +33,7 @@ processor = Wav2Vec2Processor.from_pretrained(model_name)
34
  s2t = Speech2Text()
35
 
36
  def asr(path):
 
37
  return s2t(path)
38
 
39
  # themes="default", "huggingface", "seafoam", "grass", "peach"
 
19
 
20
  def feature2logits(self, features):
21
  with torch.no_grad():
22
+ return wav2vec_model(features.input_values[0].to(device)).logits.numpy()[0]
 
23
 
24
  def __call__(self, path):
25
  logits = self.feature2logits(self.wav2feature(path))
 
33
  s2t = Speech2Text()
34
 
35
  def asr(path):
36
+ print(path)
37
  return s2t(path)
38
 
39
  # themes="default", "huggingface", "seafoam", "grass", "peach"