Instructions to use AXERA-TECH/CosyVoice3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AXERA-TECH/CosyVoice3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="AXERA-TECH/CosyVoice3")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AXERA-TECH/CosyVoice3", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download run_api_axcl_aarch64.sh from AXERA-TECH/CosyVoice3: direct link, hf CLI and curl.
- Browser
- Download file 914 Bytes
-
https://huggingface.co/AXERA-TECH/CosyVoice3/resolve/main/run_api_axcl_aarch64.sh
- Command line
-
hf download hf://AXERA-TECH/CosyVoice3/run_api_axcl_aarch64.sh
-
curl -L -o run_api_axcl_aarch64.sh https://huggingface.co/AXERA-TECH/CosyVoice3/resolve/main/run_api_axcl_aarch64.sh
914 Bytes
| LLM_DIR=CosyVoice-BlankEN-Ax650-C64-P256-CTX512/ | |
| TOKEN2WAV_DIR=token2wav-axmodels/ | |
| openssl req -newkey rsa:2048 -new -nodes -x509 -days 365 -keyout server.key -out server.crt -subj "/C=CN/ST=Beijing/L=Beijing/O=YourOrg/CN=localhost" | |
| ./main_api_axcl_aarch64 \ | |
| --template_filename_axmodel "${LLM_DIR}/qwen2_p64_l%d_together.axmodel" \ | |
| --token2wav_axmodel_dir $TOKEN2WAV_DIR \ | |
| --n_timesteps 10 \ | |
| --axmodel_num 24 \ | |
| --bos 0 --eos 0 \ | |
| --filename_tokenizer_model "http://10.122.86.184:12345" \ | |
| --filename_post_axmodel "${LLM_DIR}/qwen2_post.axmodel" \ | |
| --filename_decoder_axmodel "${LLM_DIR}/llm_decoder.axmodel" \ | |
| --filename_tokens_embed "${LLM_DIR}/model.embed_tokens.weight.bfloat16.bin" \ | |
| --filename_llm_embed "${LLM_DIR}/llm.speech_embedding.float16.bin" \ | |
| --filename_speech_embed "${LLM_DIR}/llm.speech_embedding.float16.bin" \ | |
| --continue 0 \ | |
| --devices "0," \ | |
| --prompt_files prompt_files | |
| chmod 777 output*.wav | |