diff --git a/vox_box/elstimator/bark.py b/vox_box/estimator/bark.py similarity index 97% rename from vox_box/elstimator/bark.py rename to vox_box/estimator/bark.py index 8aae0ee..db227e4 100644 --- a/vox_box/elstimator/bark.py +++ b/vox_box/estimator/bark.py @@ -4,13 +4,13 @@ from typing import Dict from vox_box.config.config import BackendEnum, Config, TaskTypeEnum from vox_box.downloader.downloaders import download_model -from vox_box.elstimator.base import Elstimator +from vox_box.estimator.base import Estimator from vox_box.utils.model import create_model_dict logger = logging.getLogger(__name__) -class Bark(Elstimator): +class Bark(Estimator): def __init__( self, cfg: Config, diff --git a/vox_box/elstimator/base.py b/vox_box/estimator/base.py similarity index 91% rename from vox_box/elstimator/base.py rename to vox_box/estimator/base.py index 088de42..1f05642 100644 --- a/vox_box/elstimator/base.py +++ b/vox_box/estimator/base.py @@ -3,7 +3,7 @@ from vox_box.config.config import Config -class Elstimator(ABC): +class Estimator(ABC): def __init__( self, cfg: Config, diff --git a/vox_box/elstimator/cosyvoice.py b/vox_box/estimator/cosyvoice.py similarity index 96% rename from vox_box/elstimator/cosyvoice.py rename to vox_box/estimator/cosyvoice.py index 2d51a39..1d6c773 100644 --- a/vox_box/elstimator/cosyvoice.py +++ b/vox_box/estimator/cosyvoice.py @@ -3,7 +3,7 @@ from typing import Dict from vox_box.downloader.downloaders import download_model -from vox_box.elstimator.base import Elstimator +from vox_box.estimator.base import Estimator from vox_box.config.config import BackendEnum, Config, TaskTypeEnum from vox_box.utils.model import create_model_dict @@ -11,7 +11,7 @@ logger = logging.getLogger(__name__) -class CosyVoice(Elstimator): +class CosyVoice(Estimator): def __init__( self, cfg: Config, diff --git a/vox_box/elstimator/estimate.py b/vox_box/estimator/estimate.py similarity index 57% rename from vox_box/elstimator/estimate.py rename to vox_box/estimator/estimate.py index 7a02d87..537c03e 100644 --- a/vox_box/elstimator/estimate.py +++ b/vox_box/estimator/estimate.py @@ -1,15 +1,15 @@ from typing import Dict, List from vox_box.config.config import Config -from vox_box.elstimator.bark import Bark -from vox_box.elstimator.base import Elstimator -from vox_box.elstimator.cosyvoice import CosyVoice -from vox_box.elstimator.faster_whisper import FasterWhisper -from vox_box.elstimator.funasr import FunASR +from vox_box.estimator.bark import Bark +from vox_box.estimator.base import Estimator +from vox_box.estimator.cosyvoice import CosyVoice +from vox_box.estimator.faster_whisper import FasterWhisper +from vox_box.estimator.funasr import FunASR from vox_box.utils.model import create_model_dict def estimate_model(cfg: Config) -> Dict: - elstimator: List[Elstimator] = [ + estimators: List[Estimator] = [ FasterWhisper(cfg), FunASR(cfg), CosyVoice(cfg), @@ -21,7 +21,11 @@ def estimate_model(cfg: Config) -> Dict: model, supported=False, ) - for e in elstimator: + + def get_model_info(estimator: Estimator) -> Dict: + return estimator.model_info() + + for e in estimators: model_info = e.model_info() if model_info["supported"]: return model_info diff --git a/vox_box/elstimator/faster_whisper.py b/vox_box/estimator/faster_whisper.py similarity index 98% rename from vox_box/elstimator/faster_whisper.py rename to vox_box/estimator/faster_whisper.py index addbe0f..2235431 100644 --- a/vox_box/elstimator/faster_whisper.py +++ b/vox_box/estimator/faster_whisper.py @@ -5,14 +5,14 @@ from vox_box.config.config import BackendEnum, Config, TaskTypeEnum from vox_box.downloader.downloaders import download_model from vox_box.downloader.hub import match_files -from vox_box.elstimator.base import Elstimator +from vox_box.estimator.base import Estimator from vox_box.utils.model import create_model_dict from faster_whisper.transcribe import WhisperModel logger = logging.getLogger(__name__) -class FasterWhisper(Elstimator): +class FasterWhisper(Estimator): def __init__( self, cfg: Config, diff --git a/vox_box/elstimator/funasr.py b/vox_box/estimator/funasr.py similarity index 98% rename from vox_box/elstimator/funasr.py rename to vox_box/estimator/funasr.py index 9a61c19..392d393 100644 --- a/vox_box/elstimator/funasr.py +++ b/vox_box/estimator/funasr.py @@ -6,14 +6,14 @@ import yaml from vox_box.config.config import BackendEnum, Config, TaskTypeEnum from vox_box.downloader.downloaders import download_model -from vox_box.elstimator.base import Elstimator +from vox_box.estimator.base import Estimator from vox_box.utils.model import create_model_dict logger = logging.getLogger(__name__) -class FunASR(Elstimator): +class FunASR(Estimator): def __init__( self, cfg: Config, diff --git a/vox_box/server/model.py b/vox_box/server/model.py index 980523c..8a0f048 100644 --- a/vox_box/server/model.py +++ b/vox_box/server/model.py @@ -7,7 +7,7 @@ from vox_box.backends.tts.cosyvoice import CosyVoice from vox_box.config.config import BackendEnum, Config from vox_box.downloader import downloaders -from vox_box.elstimator.estimate import estimate_model +from vox_box.estimator.estimate import estimate_model _instance = None