Automatic Speech Recognition
Transformers
TensorBoard
Safetensors
msp
Generated from Trainer
custom_code
Instructions to use MahmoodAnaam/MSP-Fusion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MahmoodAnaam/MSP-Fusion with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="MahmoodAnaam/MSP-Fusion", trust_remote_code=True)# Load model directly from transformers import AutoModelForCTC model = AutoModelForCTC.from_pretrained("MahmoodAnaam/MSP-Fusion", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
| from transformers import PretrainedConfig | |
| from transformers.utils import logging | |
| from .configuration_avhubert import AVHubertConfig | |
| logger = logging.get_logger(__name__) | |
| class MSPVisualConfig(PretrainedConfig): | |
| model_type = "msp_visual" | |
| sub_configs = {"visual_config": AVHubertConfig} | |
| def __init__( | |
| self, | |
| visual_config: AVHubertConfig | None | dict = None, | |
| final_dropout: float = 0.1, | |
| vocab_size: int = 32, | |
| ctc_loss_reduction: str = "mean", | |
| ctc_zero_infinity: bool = True, | |
| pad_token_id=0, | |
| bos_token_id=1, | |
| eos_token_id=2, | |
| **kwargs, | |
| ): | |
| super().__init__(**kwargs) | |
| if visual_config is not None: | |
| if isinstance(visual_config, dict): | |
| self.visual_config = AVHubertConfig(**visual_config) | |
| elif isinstance(visual_config, AVHubertConfig): | |
| self.visual_config = visual_config | |
| else: | |
| raise ValueError("visual_config must be a dict or AVHubertConfig.") | |
| else: | |
| self.visual_config = AVHubertConfig() | |
| self.final_dropout = final_dropout | |
| self.vocab_size = vocab_size | |
| self.ctc_loss_reduction = ctc_loss_reduction | |
| self.ctc_zero_infinity = ctc_zero_infinity | |
| self.pad_token_id = pad_token_id | |
| self.bos_token_id = bos_token_id | |
| self.eos_token_id = eos_token_id | |
| def hidden_size(self): | |
| return self.visual_config.adim | |