Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -5,17 +5,12 @@ import torch
|
|
5 |
import librosa
|
6 |
import json
|
7 |
|
8 |
-
with open('ISO_codes.json', 'r') as file:
|
9 |
-
iso_codes = json.load(file)
|
10 |
-
|
11 |
-
languages = list(iso_codes.keys())
|
12 |
-
|
13 |
model_id = "cawoylel/windanam_mms-1b-tts_v2"
|
14 |
-
processor = AutoProcessor.from_pretrained(model_id)
|
15 |
-
model = Wav2Vec2ForCTC.from_pretrained(model_id)
|
16 |
-
model = BetterTransformer.transform(model)
|
17 |
|
18 |
-
pipe = pipeline("automatic-speech-recognition", model=
|
19 |
|
20 |
def transcribe(audio_file_mic=None, audio_file_upload=None):
|
21 |
if audio_file_mic:
|
|
|
5 |
import librosa
|
6 |
import json
|
7 |
|
|
|
|
|
|
|
|
|
|
|
8 |
model_id = "cawoylel/windanam_mms-1b-tts_v2"
|
9 |
+
# processor = AutoProcessor.from_pretrained(model_id)
|
10 |
+
# model = Wav2Vec2ForCTC.from_pretrained(model_id)
|
11 |
+
# model = BetterTransformer.transform(model)
|
12 |
|
13 |
+
pipe = pipeline("automatic-speech-recognition", model=model_id) #, tokenizer=processor.tokenizer, feature_extractor=processor.feature_extractor)
|
14 |
|
15 |
def transcribe(audio_file_mic=None, audio_file_upload=None):
|
16 |
if audio_file_mic:
|