moro23 commited on
Commit
98939b7
·
1 Parent(s): 683af31

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -1,5 +1,6 @@
1
  #Importing all the necessary packages
2
  import nltk
 
3
  import librosa
4
  import torch
5
  import gradio as gr
@@ -16,8 +17,9 @@ model = Wav2Vec2ForCTC.from_pretrained(model_name, use_auth_token=token_value)
16
 
17
  def load_data(input_file):
18
 
 
19
  #reading the file
20
- speech, sample_rate = librosa.load(input_file)
21
  #make it 1-D
22
  if len(speech.shape) > 1:
23
  speech = speech[:,0] + speech[:,1]
 
1
  #Importing all the necessary packages
2
  import nltk
3
+ import soundfile
4
  import librosa
5
  import torch
6
  import gradio as gr
 
17
 
18
  def load_data(input_file):
19
 
20
+ sfo = soundfile.SoundFile(librosa.ex(input_file))
21
  #reading the file
22
+ speech, sample_rate = librosa.load(sfo)
23
  #make it 1-D
24
  if len(speech.shape) > 1:
25
  speech = speech[:,0] + speech[:,1]