dskill/DiffRhythm
2
1# DiffRhythm Project Guide2 3## Commands4- Run web interface: `python app.py`5- Install dependencies: `pip install -r requirements.txt`6 7## Code Style Guidelines8- **Imports:** Standard lib first, third-party second, local imports last9- **Type Annotations:** Use tensor dimension annotation style10 - `float["b n d"]` where b=batch, n=sequence length, d=dimension11- **Naming:** Functions/variables: `snake_case`, Classes: `PascalCase`, Constants: `UPPER_CASE`12- **Utils:** Use existing helper functions (`exists()`, `default()`)13- **Error Handling:** Use try/except with specific error messages14 15## Project Structure16- `app.py` - Main entry point with Gradio web interface17- `diffrhythm/` - Core library components:18 - `config/` - Model configs in JSON/INI format19 - `g2p/` - Grapheme-to-phoneme for multiple languages20 - `infer/` - Inference code for music generation21 - `model/` - DiT and CFM model architecture22 23## Architecture Notes24- Models take lyrics with timestamps (LRC) as input25- Uses audio/text style prompts to guide music generation26- Employs diffusion models that align with lyrics27- Maintain dimension consistency when working with tensors