Spaces:
Running
on
Zero
Running
on
Zero
A newer version of the Gradio SDK is available:
5.49.1
DiffRhythm Project Guide
Commands
- Run web interface:
python app.py - Install dependencies:
pip install -r requirements.txt
Code Style Guidelines
- Imports: Standard lib first, third-party second, local imports last
- Type Annotations: Use tensor dimension annotation style
float["b n d"]where b=batch, n=sequence length, d=dimension
- Naming: Functions/variables:
snake_case, Classes:PascalCase, Constants:UPPER_CASE - Utils: Use existing helper functions (
exists(),default()) - Error Handling: Use try/except with specific error messages
Project Structure
app.py- Main entry point with Gradio web interfacediffrhythm/- Core library components:config/- Model configs in JSON/INI formatg2p/- Grapheme-to-phoneme for multiple languagesinfer/- Inference code for music generationmodel/- DiT and CFM model architecture
Architecture Notes
- Models take lyrics with timestamps (LRC) as input
- Uses audio/text style prompts to guide music generation
- Employs diffusion models that align with lyrics
- Maintain dimension consistency when working with tensors