notagen-models / README.md
AEmotionStudio's picture
Add NotaGen-X safetensors mirror (MIT, from ElectricAlexis/NotaGen)
b13b860 verified
---
license: mit
library_name: pytorch
tags:
- music-generation
- symbolic-music
- abc-notation
- classical
- transformer
pipeline_tag: text-to-audio
---
# NotaGen-X — MAESTRO Mirror
Safetensors mirror of the NotaGen-X model weights, used by
[MAESTRO](https://github.com/AEmotionStudio) for the AI-Workstation "Create →
NotaGen" model card.
This repository ships **only the model weights** (no optimizer state) in the
[safetensors](https://github.com/huggingface/safetensors) format, so they load
into MAESTRO without arbitrary-code execution risk. The original upstream
checkpoints from `ElectricAlexis/NotaGen` are PyTorch `.pth` files bundling
optimizer state, epoch counters, etc.
## Files
| File | Purpose |
| --- | --- |
| `model.safetensors` | NotaGen-X model state dict (516 M params, fp32, ~1.92 GB) |
| `config.json` | Architecture hyperparameters consumed by NotaGen's loader |
| `README.md` | This file |
## Provenance
* Upstream:
[`ElectricAlexis/NotaGen`](https://huggingface.co/ElectricAlexis/NotaGen)
· file `weights_notagenx_p_size_16_p_length_1024_p_layers_20_h_size_1280.pth`
* Conversion: `torch.load(...)['model']` → contiguous CPU tensors →
`safetensors.torch.save_file(...)`. Round-trip verified (zero mismatches over
all 323 tensors).
* Training metadata preserved in safetensors header
(`epoch`, `best_epoch`, `min_eval_loss`).
## Architecture
Hierarchical Tunesformer (GPT-2 backbone) generating ABC notation:
* `p_size = 16` (patch size)
* `p_length = 1024` (patch sequence length)
* `p_layers = 20` (patch-level decoder layers)
* `c_layers = 6` (character-level decoder layers)
* `h_size = 1280` (hidden size)
## Loading
```python
from safetensors.torch import load_file
state = load_file("model.safetensors")
# Pass to NotaGen's model class — same key layout as the upstream `.pth`'s
# `["model"]` sub-dict.
```
MAESTRO's loader (`backend/ai/models/notagen.py`) handles this automatically and,
if the upstream NotaGen inference script demands a `.pth` on disk, materialises
one alongside the safetensors on first load.
## License
MIT, inherited from upstream NotaGen.