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)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("TeraSpace/TeraTTSv2", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Accept AutoModel framework loading options
Browse files- modeling_teratts.py +15 -0
modeling_teratts.py
CHANGED
|
@@ -48,6 +48,21 @@ class TeraTTSModel(PreTrainedModel):
|
|
| 48 |
"""
|
| 49 |
if model_args:
|
| 50 |
raise TypeError("TeraTTSModel.from_pretrained accepts no positional model arguments")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
source = Path(pretrained_model_name_or_path)
|
| 52 |
if source.is_dir():
|
| 53 |
release = source
|
|
|
|
| 48 |
"""
|
| 49 |
if model_args:
|
| 50 |
raise TypeError("TeraTTSModel.from_pretrained accepts no positional model arguments")
|
| 51 |
+
# ``AutoModel`` forwards these framework-only values to a custom
|
| 52 |
+
# class after it has already used them. This ONNX runtime has no
|
| 53 |
+
# adapters or PyTorch state dict to load, so safely discard them.
|
| 54 |
+
for key in (
|
| 55 |
+
"trust_remote_code",
|
| 56 |
+
"adapter_kwargs",
|
| 57 |
+
"_from_auto",
|
| 58 |
+
"use_safetensors",
|
| 59 |
+
"weights_only",
|
| 60 |
+
"low_cpu_mem_usage",
|
| 61 |
+
"device_map",
|
| 62 |
+
"torch_dtype",
|
| 63 |
+
"dtype",
|
| 64 |
+
):
|
| 65 |
+
kwargs.pop(key, None)
|
| 66 |
source = Path(pretrained_model_name_or_path)
|
| 67 |
if source.is_dir():
|
| 68 |
release = source
|