Spaces:
Running
on
Zero
Running
on
Zero
Add project documentation with commands, code style and architecture notes
Browse files🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
CLAUDE.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DiffRhythm Project Guide
|
| 2 |
+
|
| 3 |
+
## Commands
|
| 4 |
+
- Run web interface: `python app.py`
|
| 5 |
+
- Install dependencies: `pip install -r requirements.txt`
|
| 6 |
+
|
| 7 |
+
## Code Style Guidelines
|
| 8 |
+
- **Imports:** Standard lib first, third-party second, local imports last
|
| 9 |
+
- **Type Annotations:** Use tensor dimension annotation style
|
| 10 |
+
- `float["b n d"]` where b=batch, n=sequence length, d=dimension
|
| 11 |
+
- **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 messages
|
| 14 |
+
|
| 15 |
+
## Project Structure
|
| 16 |
+
- `app.py` - Main entry point with Gradio web interface
|
| 17 |
+
- `diffrhythm/` - Core library components:
|
| 18 |
+
- `config/` - Model configs in JSON/INI format
|
| 19 |
+
- `g2p/` - Grapheme-to-phoneme for multiple languages
|
| 20 |
+
- `infer/` - Inference code for music generation
|
| 21 |
+
- `model/` - DiT and CFM model architecture
|
| 22 |
+
|
| 23 |
+
## Architecture Notes
|
| 24 |
+
- Models take lyrics with timestamps (LRC) as input
|
| 25 |
+
- Uses audio/text style prompts to guide music generation
|
| 26 |
+
- Employs diffusion models that align with lyrics
|
| 27 |
+
- Maintain dimension consistency when working with tensors
|