Views
No views yet
| File | num_bars_map | Infill | Attributes | Status |
|---|---|---|---|---|
yellow_medium-final.safetensors | 4, 8 | yes | note density, polyphony (min/max), note duration (min/max) | complete (500k steps) |
yellow_small-final.safetensors | 4, 8 | yes | note density, polyphony (min/max), note duration (min/max) | complete (500k steps) |
prism_medium-step376000.safetensors | 4, 8, 12, 16 | yes | key signature, pitch range, silence, note duration, note density (bar), polyphony (bar), pitch class set, genre | training in progress (376k / 500k steps) |
expressive_medium-step90000.safetensors | 4, 8, 12, 16 | yes | key signature, pitch range, silence, note duration, note density (bar), polyphony (bar), pitch class set, nomml, genre | training in progress (90k / 500k steps) |
prism_medium and expressive_medium are mid-training checkpoints, not final snapshots — expect
loss to keep improving and these files to be superseded as training continues. InferenceEngine.from_pretrained(name)
always resolves to the newest checkpoint for that name. ghost (an extended architecture with a
MaskBar vocabulary token and up to 16-bar context) is currently training for the first time and
has no checkpoint uploaded here yet.model_dim in InferenceConfig is the context window in bars, not a vocabulary dimension — pass a
value from the model's num_bars_map. expressive additionally encodes sub-grid timing via delta
tokens and supports switchable velocity/microtiming controls. See
docs/models.md in the GitHub
repository for the full breakdown.pip install "midigpt[inference]"1from midigpt import Score
2from midigpt.inference.engine import InferenceEngine
3from midigpt.inference.config import GenerationRequest, InferenceConfig, TrackPrompt
4
5# Download and cache the model automatically
6engine = InferenceEngine.from_pretrained("yellow") # or "prism_medium", "expressive"
7
8# Load a MIDI file
9score = Score.from_midi("my_song.mid")
10
11# Infill bars 4–7 on track 0 given surrounding context
12request = GenerationRequest(
13 tracks=[
14 TrackPrompt(id=0, bars=list(range(4, 8))),
15 ],
16 config=InferenceConfig(model_dim=8),
17)
18
19session = engine.session(score, request)
20result = session.run()
21result.to_midi("output.mid")huggingface_hub in ~/.cache/huggingface/hub/.midigpt training pipeline
with PyTorch Lightning. Training configs and the preprocessing pipeline are
available in the GitHub repository.1@misc{pasquier2025midigptcontrollablegenerativemodel,
2 title={MIDI-GPT: A Controllable Generative Model for Computer-Assisted Multitrack Music Composition},
3 author={Philippe Pasquier and Jeff Ens and Nathan Fradet and Paul Triana and Davide Rizzotti and Jean-Baptiste Rolland and Maryam Safi},
4 year={2025},
5 eprint={2501.17011},
6 archivePrefix={arXiv},
7 primaryClass={cs.SD},
8 url={https://arxiv.org/abs/2501.17011},
9}