Download model/__init__.py from sgfw/kronos: direct link, hf CLI and curl.
- Browser
- Download file 622 Bytes
-
https://huggingface.co/spaces/sgfw/kronos/resolve/main/model/__init__.py
- Command line
-
hf download hf://spaces/sgfw/kronos/model/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/sgfw/kronos/resolve/main/model/__init__.py
622 Bytes
| # -*- coding: utf-8 -*- | |
| try: | |
| from .kronos import KronosTokenizer, Kronos, KronosPredictor | |
| model_dict = { | |
| 'kronos_tokenizer': KronosTokenizer, | |
| 'kronos': Kronos, | |
| 'kronos_predictor': KronosPredictor | |
| } | |
| def get_model_class(model_name): | |
| if model_name in model_dict: | |
| return model_dict[model_name] | |
| else: | |
| raise NotImplementedError(f"Model {model_name} not found") | |
| except ImportError: | |
| model_dict = {} | |
| def get_model_class(model_name): | |
| raise NotImplementedError(f"Model {model_name} not available (torch not installed)") | |