Download lib/asr_models/base_model.py from yujuanqin/TestTranslator: direct link, hf CLI and curl.
- Browser
- Download file 590 Bytes
-
https://huggingface.co/yujuanqin/TestTranslator/resolve/main/lib/asr_models/base_model.py
- Command line
-
hf download hf://yujuanqin/TestTranslator/lib/asr_models/base_model.py
-
curl -L -o base_model.py https://huggingface.co/yujuanqin/TestTranslator/resolve/main/lib/asr_models/base_model.py
590 Bytes
| from abc import ABC, abstractmethod | |
| from enum import Enum | |
| class AbstractASRModel(ABC): | |
| def __init__(self, device='cpu'): | |
| self.device = device | |
| self.name = "AbstractASRModel" | |
| def load(self, model_dir, language): | |
| raise NotImplementedError | |
| def transcribe(self, wav, language): | |
| raise NotImplementedError | |
| class ModelName(Enum): | |
| WHISPER = "whisper" | |
| WHISPER_FINETUNED = "whisper_finetuned" | |
| FUNASR_NANO = "funasr_nano" | |
| FUNASR_MLT_NANO = "funasr_mlt_nano" | |
| FUNASR_QUANT = "funasr_quant" | |