Shao

Shao Logo ### Shao: High-Fidelity Music Generation With a Unified Acoustic-Token Pipeline English | [中文](/Shao/README_zh.html)
Demo Paper Model Weights Environment Setup Backend Docs

✨ What Is Shao?

Rename Notice

This project was formerly known as Khala and has been officially renamed to Shao. The model, codebase, and research direction remain unchanged; the rename is intended to unify the project’s long-term identity across papers, GitHub, demos, and future releases.

Shao is the English name of 韶元. “韶” is associated with beautiful music and also evokes classical court music and cultural continuity, while “元” refers to origin, foundation, and first principle.

Shao is an open-source system for high-fidelity music generation, capable of generating complete musical works from text descriptions and lyric conditions. Unlike approaches built around semantic tokens, diffusion models, or multi-stage audio generation stacks, Shao follows a unified acoustic-token route and generates both coarse musical structure and fine acoustic detail within the same discrete audio representation space.

The core characteristics of Shao include:

📰 News

✅ Updated

⏳ TODOs

🖥️ Web UI

Prompt Mode

Shao Frontend Prompt Mode

Tag Mode

Shao Frontend Tag Mode

🎧 Audio Samples

Listen to generated samples on the online demo page: Shao Demo

✅ Runtime Requirements

The current release is mainly intended for researchers and developers who are already familiar with GPU servers.

🚀 Quick Start

This section is intended for researchers and developers who are already comfortable with basic Docker and CUDA workflows, and provides the shortest path to running the system.

If you want to configure the environment step by step from a clean NGC container, please read:

If you want to understand the backend structure and runtime logic, please read:

1. Prepare the runtime environment

The currently available prebuilt image is:

docker pull ghcr.io/davidliujiafeng/khala-env:ngc25.02-node24

docker run --gpus all -it --rm \
  --name shao \
  -p 30869:30869 \
  -p 8889:8889 \
  ghcr.io/davidliujiafeng/khala-env:ngc25.02-node24

Note: the command above uses --rm, so files created inside the container will be removed after the container exits. If you want a long-lived development container or want to keep downloaded model weights, use a mounted directory or remove --rm.

2. Clone the repository

After entering the container, run:

cd /workspace
git clone https://github.com/Shao-Music-AI/Shao.git
cd Shao

3. Download the model checkpoints

Model repository:

From the repository root, run:

mkdir -p checkpoints
hf download liujiafeng/Shao-MusicGeneration-v1.0 --local-dir checkpoints

This command downloads the model repository contents into the local checkpoints/ directory.

4. Start the backend

cd /workspace/Shao/backend
bash run_backend.sh

The default launcher now starts in a single-GPU safe mode. Advanced users can also select specific GPU ids and switch between one_shot and keep_loaded runtime modes from the same script; see backend/README_backend.md for details.

5. Start the frontend

In another terminal, run:

cd /workspace/Shao/frontend
npm install
npm run dev

6. Open the web UI

Default URL:

🧠 System Overview

The current system has three layers:

The request path is:

flowchart LR
    A["Frontend UI"] --> B["backend_api.py"]
    B --> C["backend_worker.py"]
    C --> D["Backbone"]
    D --> E["Super-resolution"]
    E --> F["Decoder"]
    F --> G["Generated Audio"]
    G --> B
    B --> A

🔗 Project Resources

🗂 Repository Structure

Shao/
├── backend/
├── frontend/
├── core/
├── models/
├── checkpoints/
├── assets/
├── Dockerfile
├── requirements.txt
├── ENVIRONMENT_SETUP.md
└── ENVIRONMENT_SETUP_zh.md

Main directories:

📚 Citation

If this project is helpful to your research or development work, you are welcome to cite our paper:

The final BibTeX information will be added later to both the paper page and the repository documentation.

🙏 Acknowledgements

The current implementation builds on a number of excellent open-source projects and tools, including but not limited to:

📜 License

The model weights are currently intended to be released under CC BY-NC 4.0 (Creative Commons Attribution-NonCommercial 4.0 International).

💬 Contact

Feel free to join the WeChat group for discussion, usage questions, and future updates:

Shao WeChat Group QR Code