Spaces:
Runtime error
Runtime error
Vaibhav Srivastav
commited on
Commit
·
2b858ac
1
Parent(s):
7806ecb
removing pre-loading of weights
Browse files
app.py
CHANGED
@@ -11,12 +11,9 @@ def return_processor_and_model(model_name):
|
|
11 |
return Wav2Vec2Processor.from_pretrained(model_name), AutoModelForCTC.from_pretrained(model_name)
|
12 |
|
13 |
def load_and_fix_data(input_file):
|
14 |
-
#read the file
|
15 |
speech, sample_rate = librosa.load(input_file)
|
16 |
-
#make it 1D
|
17 |
if len(speech.shape) > 1:
|
18 |
speech = speech[:,0] + speech[:,1]
|
19 |
-
#resampling to 16KHz
|
20 |
if sample_rate !=16000:
|
21 |
speech = librosa.resample(speech, sample_rate,16000)
|
22 |
return speech
|
|
|
11 |
return Wav2Vec2Processor.from_pretrained(model_name), AutoModelForCTC.from_pretrained(model_name)
|
12 |
|
13 |
def load_and_fix_data(input_file):
|
|
|
14 |
speech, sample_rate = librosa.load(input_file)
|
|
|
15 |
if len(speech.shape) > 1:
|
16 |
speech = speech[:,0] + speech[:,1]
|
|
|
17 |
if sample_rate !=16000:
|
18 |
speech = librosa.resample(speech, sample_rate,16000)
|
19 |
return speech
|