Text-to-Speech
Transformers
ONNX
teratts_onnx
feature-extraction
onnxruntime
russian
english
custom-code
custom_code
Instructions to use TeraSpace/TeraTTSv2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TeraSpace/TeraTTSv2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="TeraSpace/TeraTTSv2", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("TeraSpace/TeraTTSv2", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
| """Transformers configuration for the ONNX Runtime TeraTTS release.""" | |
| from transformers import PretrainedConfig | |
| class TeraTTSConfig(PretrainedConfig): | |
| model_type = "teratts_onnx" | |
| def __init__( | |
| self, | |
| sample_rate: int = 44_100, | |
| default_diffusion_model: str = "distilled", | |
| default_voice: str = "ru_f1", | |
| voices: list[str] | None = None, | |
| automatic_russian_stress: bool = True, | |
| cross_language_prompt_note: str = ( | |
| "For an English reference voice speaking Russian, try duration_scale below 1.0." | |
| ), | |
| **kwargs, | |
| ) -> None: | |
| super().__init__(**kwargs) | |
| self.sample_rate = sample_rate | |
| self.default_diffusion_model = default_diffusion_model | |
| self.default_voice = default_voice | |
| self.voices = voices or [] | |
| self.automatic_russian_stress = automatic_russian_stress | |
| self.cross_language_prompt_note = cross_language_prompt_note | |