Instructions to use jackuh02/CosyVoice2-Yue-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use jackuh02/CosyVoice2-Yue-mlx with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir CosyVoice2-Yue-mlx jackuh02/CosyVoice2-Yue-mlx
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +63 -0
- config.json +8 -0
- model.safetensors +3 -0
- tokenizer.json +3 -0
- tokenizer_config.json +43 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: mlx-audio-plus
|
| 3 |
+
base_model:
|
| 4 |
+
- ASLP-lab/WSYue-TTS
|
| 5 |
+
tags:
|
| 6 |
+
- mlx
|
| 7 |
+
- tts
|
| 8 |
+
- cosyvoice2
|
| 9 |
+
pipeline_tag: text-to-speech
|
| 10 |
+
language:
|
| 11 |
+
- en
|
| 12 |
+
- zh
|
| 13 |
+
- ja
|
| 14 |
+
- ko
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# jackuh02/CosyVoice2-Yue-mlx
|
| 18 |
+
|
| 19 |
+
This model was converted to MLX format from [ASLP-lab/WSYue-TTS/CosyVoice2-Yue](https://huggingface.co/ASLP-lab/WSYue-TTS) using [mlx-audio-plus](https://github.com/DePasqualeOrg/mlx-audio-plus) version **0.1.8**.
|
| 20 |
+
|
| 21 |
+
## Usage
|
| 22 |
+
|
| 23 |
+
```bash
|
| 24 |
+
pip install -U mlx-audio-plus
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
### Inference Modes
|
| 28 |
+
|
| 29 |
+
| Mode | Parameters | Description |
|
| 30 |
+
|------|------------|-------------|
|
| 31 |
+
| Cross-lingual | `ref_audio` | Zero-shot TTS (default) |
|
| 32 |
+
| Zero-shot | `ref_audio` + `ref_text` | Better quality with transcription |
|
| 33 |
+
| Instruct | `ref_audio` + `instruct_text` | Style control (e.g., "speak slowly") |
|
| 34 |
+
| Voice Conversion | `source_audio` + `ref_audio` | Convert audio to target voice |
|
| 35 |
+
|
| 36 |
+
### Command line
|
| 37 |
+
|
| 38 |
+
```bash
|
| 39 |
+
# Cross-lingual (default)
|
| 40 |
+
mlx_audio.tts --model jackuh02/CosyVoice2-Yue-mlx --text "Hello!" --ref_audio ref.wav
|
| 41 |
+
|
| 42 |
+
# Zero-shot (with transcription)
|
| 43 |
+
mlx_audio.tts --model jackuh02/CosyVoice2-Yue-mlx --text "Hello!" --ref_audio ref.wav --ref_text "Transcription of ref audio."
|
| 44 |
+
|
| 45 |
+
# Instruct (style control)
|
| 46 |
+
mlx_audio.tts --model jackuh02/CosyVoice2-Yue-mlx --text "Hello!" --ref_audio ref.wav --instruct_text "Speak slowly and calmly"
|
| 47 |
+
|
| 48 |
+
# Voice Conversion
|
| 49 |
+
mlx_audio.tts --model jackuh02/CosyVoice2-Yue-mlx --source_audio source.wav --ref_audio ref.wav
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
### Python
|
| 53 |
+
|
| 54 |
+
```python
|
| 55 |
+
from mlx_audio.tts.generate import generate_audio
|
| 56 |
+
|
| 57 |
+
generate_audio(
|
| 58 |
+
text="Hello, this is CosyVoice2 on MLX!",
|
| 59 |
+
model="jackuh02/CosyVoice2-Yue-mlx",
|
| 60 |
+
ref_audio="reference.wav",
|
| 61 |
+
file_prefix="output",
|
| 62 |
+
)
|
| 63 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "cosyvoice2",
|
| 3 |
+
"version": "0.5B",
|
| 4 |
+
"sample_rate": 24000,
|
| 5 |
+
"mel_channels": 80,
|
| 6 |
+
"speech_token_size": 6561,
|
| 7 |
+
"dtype": "float16"
|
| 8 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e55b118a99b5f665b43a63db900741f6856f1f82522516ed52e1a82e9ce6b964
|
| 3 |
+
size 1564752978
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5e3855f008ece7e02f09bad5c0aa492cd1594529a796b80193f4ef640200e58b
|
| 3 |
+
size 10523354
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"added_tokens_decoder": {
|
| 4 |
+
"151643": {
|
| 5 |
+
"content": "<|endoftext|>",
|
| 6 |
+
"lstrip": false,
|
| 7 |
+
"normalized": false,
|
| 8 |
+
"rstrip": false,
|
| 9 |
+
"single_word": false,
|
| 10 |
+
"special": true
|
| 11 |
+
},
|
| 12 |
+
"151644": {
|
| 13 |
+
"content": "<|im_start|>",
|
| 14 |
+
"lstrip": false,
|
| 15 |
+
"normalized": false,
|
| 16 |
+
"rstrip": false,
|
| 17 |
+
"single_word": false,
|
| 18 |
+
"special": true
|
| 19 |
+
},
|
| 20 |
+
"151645": {
|
| 21 |
+
"content": "<|im_end|>",
|
| 22 |
+
"lstrip": false,
|
| 23 |
+
"normalized": false,
|
| 24 |
+
"rstrip": false,
|
| 25 |
+
"single_word": false,
|
| 26 |
+
"special": true
|
| 27 |
+
}
|
| 28 |
+
},
|
| 29 |
+
"additional_special_tokens": [
|
| 30 |
+
"<|im_start|>",
|
| 31 |
+
"<|im_end|>"
|
| 32 |
+
],
|
| 33 |
+
"bos_token": null,
|
| 34 |
+
"clean_up_tokenization_spaces": false,
|
| 35 |
+
"eos_token": "<|im_end|>",
|
| 36 |
+
"errors": "replace",
|
| 37 |
+
"extra_special_tokens": {},
|
| 38 |
+
"model_max_length": 32768,
|
| 39 |
+
"pad_token": "<|endoftext|>",
|
| 40 |
+
"split_special_tokens": false,
|
| 41 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 42 |
+
"unk_token": null
|
| 43 |
+
}
|