Text Generation
Transformers
Safetensors
English
Chinese
Russian
yue2
music-generation
orbitquant
quantization
4-bit precision
custom-code
8-bit precision
Instructions to use WaveCut/YuE2-3B-OrbitQuant-W4A4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use WaveCut/YuE2-3B-OrbitQuant-W4A4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="WaveCut/YuE2-3B-OrbitQuant-W4A4")# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("WaveCut/YuE2-3B-OrbitQuant-W4A4", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use WaveCut/YuE2-3B-OrbitQuant-W4A4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "WaveCut/YuE2-3B-OrbitQuant-W4A4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WaveCut/YuE2-3B-OrbitQuant-W4A4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/WaveCut/YuE2-3B-OrbitQuant-W4A4
- SGLang
How to use WaveCut/YuE2-3B-OrbitQuant-W4A4 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "WaveCut/YuE2-3B-OrbitQuant-W4A4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WaveCut/YuE2-3B-OrbitQuant-W4A4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "WaveCut/YuE2-3B-OrbitQuant-W4A4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WaveCut/YuE2-3B-OrbitQuant-W4A4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use WaveCut/YuE2-3B-OrbitQuant-W4A4 with Docker Model Runner:
docker model run hf.co/WaveCut/YuE2-3B-OrbitQuant-W4A4
| TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) { | |
| ops.def("rmsquant(Tensor! packed, Tensor! norms, Tensor x, Tensor weight, Tensor permutation, Tensor signs, Tensor boundaries, float rms_eps, float quant_eps) -> ()"); | |
| ops.impl("rmsquant", torch::kCUDA, &rmsquant); | |
| ops.def("orbitquant_gemv(Tensor! out, Tensor x, Tensor w, Tensor xn, Tensor wn, Tensor ac, Tensor wc, Tensor bias, bool has_bias, float activation_scale, float weight_scale) -> ()"); | |
| ops.impl("orbitquant_gemv", torch::kCUDA, &orbitquant_gemv); | |
| ops.def("yue2_rmsnorm(Tensor! out, Tensor x, Tensor weight, float eps) -> ()"); | |
| ops.impl("yue2_rmsnorm", torch::kCUDA, &yue2_rmsnorm); | |
| ops.def("yue2_rope(Tensor! out, Tensor x, Tensor cos, Tensor sin, int heads) -> ()"); | |
| ops.impl("yue2_rope", torch::kCUDA, &yue2_rope); | |
| ops.def("yue2_swiglu(Tensor! out, Tensor x) -> ()"); | |
| ops.impl("yue2_swiglu", torch::kCUDA, &yue2_swiglu); | |
| ops.def("yue2_qkv_decode(Tensor! q, Tensor! keys, Tensor! values, Tensor x, Tensor qw, Tensor kw, Tensor cos, Tensor sin, Tensor positions, float eps) -> ()"); | |
| ops.impl("yue2_qkv_decode", torch::kCUDA, &yue2_qkv_decode); | |
| ops.def("yue2_rmsnorm_exact(Tensor! out, Tensor x, Tensor weight, float eps) -> ()"); | |
| ops.impl("yue2_rmsnorm_exact", torch::kCUDA, &yue2_rmsnorm_exact); | |
| ops.def("fused_gemv(Tensor! out, Tensor x, Tensor gamma, bool has_gamma, Tensor permutation, Tensor signs, Tensor boundaries, float rms_eps, float quant_eps, float inv_sqrt_block, Tensor w, Tensor wn, Tensor ac, Tensor wc, Tensor bias, bool has_bias, float activation_scale, float weight_scale, int virtual_threads) -> ()"); | |
| ops.impl("fused_gemv", torch::kCUDA, &fused_gemv); | |
| ops.def("fused_gemv2(Tensor! out, Tensor! x_new, bool write_x_new, Tensor x, Tensor h, bool has_h, Tensor gamma, bool has_gamma, Tensor permutation, Tensor signs, Tensor boundaries, float rms_eps, float quant_eps, float inv_sqrt_block, Tensor w, Tensor wn, Tensor ac, Tensor wc, Tensor bias, bool has_bias, float activation_scale, float weight_scale, int virtual_threads) -> ()"); | |
| ops.impl("fused_gemv2", torch::kCUDA, &fused_gemv2); | |
| ops.def("rmsquant_add(Tensor! packed, Tensor! norms, Tensor! x_new, Tensor x, Tensor h, Tensor weight, Tensor permutation, Tensor signs, Tensor boundaries, float rms_eps, float quant_eps) -> ()"); | |
| ops.impl("rmsquant_add", torch::kCUDA, &rmsquant_add); | |
| ops.def("quantize_rows_int8(Tensor! out, Tensor! scales, Tensor x) -> ()"); | |
| ops.impl("quantize_rows_int8", torch::kCUDA, &quantize_rows_int8); | |
| ops.def("gemv_w8a8(Tensor! out, Tensor x, Tensor xs, Tensor w, Tensor ws) -> ()"); | |
| ops.impl("gemv_w8a8", torch::kCUDA, &gemv_w8a8); | |
| } | |
| REGISTER_EXTENSION(TORCH_EXTENSION_NAME) | |