Downloads · 30 days
28
18% of all-time downloads
wookee3/cosyvoice3-speech-tokenizer-pt
cosyvoice3-speech-tokenizer-pt is a feature extraction model from wookee3. Use it when you need embeddings to search or compare text. It is set up for transformers. The card lists the license as apache-2.0.
This repository stores a PyTorch checkpoint converted from ONNX initializers.
Downloads · 30 days
28
18% of all-time downloads
All-time downloads
152
Public
Repo size
968 MB
Likes
0
Public
Click a slice to open those files.
.bin968 MB · 100%
From the Hugging Face model README
This repository stores a PyTorch checkpoint converted from ONNX initializers.
pytorch_model.bintrust_remote_code=True loading.configuration_onnx_parameter_store.py, modeling_onnx_parameter_store.py, config.json, onnx_parameter_map.json are required for AutoModel.from_pretrained(..., trust_remote_code=True).from transformers import AutoModel
model = AutoModel.from_pretrained(
"wookee3/cosyvoice3-speech-tokenizer-pt",
trust_remote_code=True,
)
print(len(model.weights))
from transformers import AutoModel
model = AutoModel.from_pretrained(
"wookee3/cosyvoice3-speech-tokenizer-pt",
trust_remote_code=True,
)
# downloads speech_tokenizer_v3.onnx from source repo automatically
indices = model.tokenize_from_file("/path/to/audio.wav")
print(indices.shape)
print(indices[0].tolist()[:30])
This repo does not include ONNX file intentionally. The example script downloads
speech_tokenizer_v3.onnx from source repo at runtime.
pip install numpy soundfile onnxruntime huggingface_hub
python audio_to_tokens_example.py --audio /path/to/audio.wav
Or specify a local ONNX path:
python audio_to_tokens_example.py \
--audio /path/to/audio.wav \
--onnx /path/to/speech_tokenizer_v3.onnx