Automatic Speech Recognition
Transformers
Safetensors
phoneticxeus
feature-extraction
phone-recognition
ipa
ctc
multilingual
xeus
custom_code
Instructions to use changelinglab/PhoneticXeus with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use changelinglab/PhoneticXeus with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="changelinglab/PhoneticXeus", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("changelinglab/PhoneticXeus", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Add trust_remote_code support: AutoModel + safetensors + vendored src + beginner README
8d83dee verified | """Linear Projection.""" | |
| from typing import Tuple | |
| import torch | |
| class LinearProjection(torch.nn.Module): | |
| def __init__(self, input_size: int, output_size: int, dropout: float = 0.0): | |
| super().__init__() | |
| self.output_dim = output_size | |
| self.linear_out = torch.nn.Linear(input_size, output_size) | |
| self.dropout = torch.nn.Dropout(dropout) | |
| def forward( | |
| self, input: torch.Tensor, input_lengths: torch.Tensor | |
| ) -> Tuple[torch.Tensor, torch.Tensor]: | |
| output = self.linear_out(self.dropout(input)) | |
| return output, input_lengths # no state in this layer | |
| def output_size(self) -> int: | |
| return self.output_dim | |