Instructions to use openbmb/VoxCPM-0.5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- VoxCPM
How to use openbmb/VoxCPM-0.5B with VoxCPM:
import soundfile as sf from voxcpm import VoxCPM model = VoxCPM.from_pretrained("openbmb/VoxCPM-0.5B") wav = model.generate( text="VoxCPM is an innovative end-to-end TTS model from ModelBest, designed to generate highly expressive speech.", prompt_wav_path=None, # optional: path to a prompt speech for voice cloning prompt_text=None, # optional: reference text cfg_value=2.0, # LM guidance on LocDiT, higher for better adherence to the prompt, but maybe worse inference_timesteps=10, # LocDiT inference timesteps, higher for better result, lower for fast speed normalize=True, # enable external TN tool denoise=True, # enable external Denoise tool retry_badcase=True, # enable retrying mode for some bad cases (unstoppable) retry_badcase_max_times=3, # maximum retrying times retry_badcase_ratio_threshold=6.0, # maximum length restriction for bad case detection (simple but effective), it could be adjusted for slow pace speech ) sf.write("output.wav", wav, 16000) print("saved: output.wav") - Notebooks
- Google Colab
- Kaggle
[ERROR] torch._dynamo.exc.Unsupported: Unsupported method call
#17
by simzhou - opened
Got an Error when running on NVIDIA v100:
Traceback (most recent call last):
File "/hpc_stor01/home/yihua.zhou/comm_scripts/tts-VoxCPM/VoxCPM-gemerate.py", line 28, in <module>
model = VoxCPM.from_pretrained(args.model_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/voxcpm/core.py", line 86, in from_pretrained
return cls(
^^^^
File "/opt/conda/lib/python3.11/site-packages/voxcpm/core.py", line 36, in __init__
self.tts_model.generate(
File "/opt/conda/lib/python3.11/site-packages/voxcpm/model/voxcpm.py", line 176, in generate
return next(self._generate(*args, streaming=False, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 36, in generator_context
response = gen.send(None)
^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/voxcpm/model/voxcpm.py", line 300, in _generate
latent_pred, pred_audio_feat = next(inference_result)
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 36, in generator_context
response = gen.send(None)
^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/voxcpm/model/voxcpm.py", line 627, in _inference
curr_embed = self.feat_encoder_step(pred_feat.unsqueeze(1)) # b, 1, c
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1751, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1762, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/torch/_dynamo/eval_frame.py", line 659, in _fn
raise e.with_traceback(None) from None
torch._dynamo.exc.Unsupported: Unsupported method call
Explanation: Dynamo does not know how to trace method `symmetric_difference` of class `type`
Hint: Avoid calling `type.symmetric_difference` in your code.
Hint: Please report an issue to PyTorch.
Developer debug context: call_method BuiltinVariable(set) symmetric_difference [SetVariable(), SetVariable()] {}
from user code:
File "/opt/conda/lib/python3.11/site-packages/einops/einops.py", line 531, in reduce
recipe = _prepare_transformation_recipe(pattern, reduction, axes_names=tuple(axes_lengths), ndim=len(shape))
File "/opt/conda/lib/python3.11/site-packages/torch/_dynamo/polyfills/__init__.py", line 140, in getattr_and_trace
return fn(*args[2:], **kwargs)
File "/opt/conda/lib/python3.11/site-packages/einops/einops.py", line 311, in _prepare_transformation_recipe
difference = set.symmetric_difference(left.identifiers, rght.identifiers)
Set TORCHDYNAMO_VERBOSE=1 for the internal stack trace (please do this especially if you're reporting a bug to PyTorch). For even more developer context, set TORCH_LOGS="+dynamo"
Got same Error when running on NVIDIA T4
Got same Error when running on NVIDIA T4
I no longer encountered this Error after using Nvidia a10/3090/4090.
import os
os.environ["TORCHDYNAMO_DISABLE"] = "1"
add at begining
import os
os.environ["TORCHDYNAMO_DISABLE"] = "1"
add at begining
Thank you very much!
simzhou changed discussion status to closed