Spaces:
Runtime error
Runtime error
import os | |
from pathlib import Path | |
import nemo.collections.asr as nemo_asr | |
def transcribe(audio_file): | |
try: | |
text = model_kz.transcribe([audio_file]) | |
return text[0] | |
except: | |
return 'Try another file format.' | |
language = "kz" | |
BASE_DIR = Path(__file__).resolve(strict=True).parent | |
model_kz = nemo_asr.models.EncDecCTCModel.restore_from(restore_path=f"{BASE_DIR}/stt_{language}_quartznet15x5.nemo") | |