Ar4ikov commited on
Commit
879ffa6
1 Parent(s): 992daf0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -16,7 +16,7 @@ SR = 16000
16
 
17
 
18
  def resample(speech_array, sampling_rate):
19
- speech = torch.from_numpy(np.array([speech_array])).type(torch.ShortTensor)
20
  print(speech, speech.shape, sampling_rate)
21
  resampler = torchaudio.transforms.Resample(sampling_rate)
22
  speech = resampler(speech).squeeze().numpy()
@@ -41,6 +41,7 @@ model = AutoModel.from_pretrained("Aniemore/wav2vec2-xlsr-53-russian-emotion-rec
41
  feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained("Aniemore/wav2vec2-xlsr-53-russian-emotion-recognition")
42
 
43
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
 
44
 
45
 
46
  def recognize(audio):
 
16
 
17
 
18
  def resample(speech_array, sampling_rate):
19
+ speech = torch.from_numpy(np.array([speech_array])).type(torch.cuda.ShortTensor)
20
  print(speech, speech.shape, sampling_rate)
21
  resampler = torchaudio.transforms.Resample(sampling_rate)
22
  speech = resampler(speech).squeeze().numpy()
 
41
  feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained("Aniemore/wav2vec2-xlsr-53-russian-emotion-recognition")
42
 
43
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
44
+ print(device)
45
 
46
 
47
  def recognize(audio):