Download modeling_spear.py from marcoyang/spear-large-speech: direct link, hf CLI and curl.
- Browser
- Download file 505 Bytes
-
https://huggingface.co/marcoyang/spear-large-speech/resolve/75d5f67c95b5f6de897e2137d438947c6e01e6fa/modeling_spear.py
- Command line
-
hf download hf://marcoyang/spear-large-speech@75d5f67c95b5f6de897e2137d438947c6e01e6fa/modeling_spear.py
-
curl -L -o modeling_spear.py https://huggingface.co/marcoyang/spear-large-speech/resolve/75d5f67c95b5f6de897e2137d438947c6e01e6fa/modeling_spear.py
505 Bytes
| # modeling_spear.py | |
| from transformers import PreTrainedModel | |
| from .configuration_spear import SpearConfig | |
| from .spear_model import SpearModel as model | |
| class SpearModel(PreTrainedModel): | |
| config_class = SpearConfig | |
| def __init__(self, config: SpearConfig): | |
| super().__init__(config) | |
| self.model = model(config) | |
| def forward(self, *args, **kwargs): | |
| return self.model(*args, **kwargs) | |
| def load_audio(self, audio_path): | |
| return self.model.load_audio(audio_path) |