cocktailpeanut commited on
Commit
0f42775
Β·
verified Β·
1 Parent(s): 398c3aa

Mirror MuScriptor/muscriptor-medium at f32236969308

Browse files

Exact mirror of https://huggingface.co/MuScriptor/muscriptor-medium/tree/f32236969308476e01fd3aae67357de5feb05a2d

Source commit: f32236969308476e01fd3aae67357de5feb05a2d

Files changed (3) hide show
  1. README.md +170 -0
  2. config.json +8 -0
  3. model.safetensors +3 -0
README.md ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ library_name: muscriptor
4
+ extra_gated_prompt: "MuScriptor is the result of a research collaboration between Mirelo and Kyutai whose purpose is to transcribe audio to MIDI/music sheet. It is provided primarily for research purposes under the CC BY-NC 4.0 licence supplemented by the below specific conditions of use.\nSpecific conditions of use: MuScriptor and any generated content by MuScriptor are provided as is without any warranty of any kind, including but not limited to any warranty of non-infringement. Use of MuScriptor and its output must comply with all applicable laws and must not result in, involve, or facilitate any illegal or unauthorized activity. Prohibited uses include, without limitation, inputting music files and transcribing them to MIDI/music sheet without having all the necessary rights, including intellectual property rights, under applicable laws. Accordingly, users of MuScriptor undertake and warrant to have all the necessary rights, including intellectual property rights, in connection with their use of MuScriptor and its output. We disclaim all liability for any non-compliant use and users of MuScriptor shall indemnify, defend, and hold harmless Mirelo and Kyutai from and against any and all claims, damages, losses, liabilities, and expenses (including reasonable attorneys' fees) incurred by Mirelo and/or Kyutai arising out of or resulting from their failure to comply with the terms of the CC BY-NC 4.0 licence and/or these specific conditions of use."
5
+ extra_gated_fields:
6
+ Company or university if applicable: text
7
+ I am a:
8
+ type: select
9
+ options:
10
+ - Musician
11
+ - AI Researcher
12
+ - Other
13
+ tags:
14
+ - music
15
+ - music-transcription
16
+ - automatic-music-transcription
17
+ - amt
18
+ - audio-to-midi
19
+ - midi
20
+ - music-information-retrieval
21
+ - transformer
22
+ - pytorch
23
+ ---
24
+
25
+ # MuScriptor β€” medium (β‰ˆ300M)
26
+
27
+ **MuScriptor** is an open-weight model for **general-purpose, multi-instrument automatic music transcription (AMT)**: it converts a music recording (any genre, multiple simultaneous instruments) into a stream of notes played. This repository hosts the **medium** variant (β‰ˆ300M parameters), the default checkpoint downloaded by the `muscriptor` library.
28
+
29
+ `muscriptor-medium` balances quality and footprint. For the best transcription quality use [`muscriptor-large`](https://huggingface.co/MuScriptor/muscriptor-large) (β‰ˆ1.3B); for the smallest/fastest option use [`muscriptor-small`](https://huggingface.co/MuScriptor/muscriptor-small) (β‰ˆ100M).
30
+
31
+ - Developed by [Mirelo](https://www.mirelo.ai/) x [kyutai](https://kyutai.org/)
32
+ - πŸ“„ Paper: *MuScriptor: An Open Model for Multi-Instrument Music Transcription* β€” Rouard, Krause, Roebel, Simon-Gabriel, DΓ©fossez (2026). _<!-- TODO: add arXiv link once public; it will auto-cross-link on the Hub -->_
33
+ - πŸ’» Code: <https://github.com/muscriptor/muscriptor>
34
+ - πŸ”Š Audio samples: <https://muscriptor.github.io>
35
+
36
+ ## Table of contents
37
+
38
+ - [Quickstart](#quickstart)
39
+ - [Model description](#model-description)
40
+ - [Model variants](#model-variants)
41
+ - [Intended uses & limitations](#intended-uses--limitations)
42
+ - [Instrument conditioning](#instrument-conditioning)
43
+ - [Training](#training)
44
+ - [Evaluation](#evaluation)
45
+ - [Citation](#citation)
46
+ - [License](#license)
47
+
48
+ ## Quickstart
49
+
50
+ Install the `muscriptor` package (it uses `huggingface_hub` to fetch weights automatically):
51
+
52
+ ```bash
53
+ pip install git+https://github.com/muscriptor/muscriptor.git
54
+ # TODO (PyPI release forthcoming: pip install muscriptor)
55
+ ```
56
+
57
+ ### Python
58
+
59
+ ```python
60
+ from pathlib import Path
61
+ from muscriptor import TranscriptionModel
62
+
63
+ # "medium" resolves to hf://MuScriptor/muscriptor-medium and downloads on first use.
64
+ model = TranscriptionModel.load_model("medium")
65
+
66
+ # Get a MIDI file directly:
67
+ Path("out.mid").write_bytes(model.transcribe_to_midi("audio.wav"))
68
+
69
+ # Or stream note events as they are transcribed:
70
+ for event in model.transcribe("audio.wav"):
71
+ print(event) # NoteStartEvent / NoteEndEvent / ProgressEvent
72
+ ```
73
+
74
+ `load_model` accepts a size keyword (`"small"`/`"medium"`/`"large"`), a local `.safetensors` path, or an `hf://` / `https://` URL. Weights loaded by size keyword (or any `hf://` URL) are cached in the standard Hugging Face cache (`~/.cache/huggingface/hub`, configurable via `HF_HOME`); weights fetched from a plain `http(s)://` URL are cached under `~/.cache/muscriptor/`. Input audio can be WAV or any format `libsndfile` reads (mp3, flac, ogg, m4a, …); it is resampled to 16 kHz mono internally.
75
+
76
+ ### CLI
77
+
78
+ ```bash
79
+ muscriptor transcribe --model medium audio.wav -o out.mid
80
+ ```
81
+
82
+ ## Model description
83
+
84
+ MuScriptor performs transcription by **autoregressively predicting a MIDI-like token sequence** given the mel-spectrogram of a short audio segment, following the sequence-to-sequence AMT paradigm (cf. MT3). It deliberately avoids complex architectural tweaks in favor of a simple, decoder-only Transformer.
85
+
86
+ - **Architecture:** decoder-only Transformer (this variant: `dim=1024`, `num_heads=16`, `num_layers=24`).
87
+ - **Input:** raw waveform (16 kHz, mono) of a 5-second segment β†’ mel-spectrogram (STFT `n_fft=2048`, hop 160 β†’ 100 Hz frame rate, 512 mel bins). The spectrogram is projected to the model dimension and used as a prefix condition.
88
+ - **Output tokenization:** MT3-like note events; the 128 MIDI programs are mapped to **36 instrument subgroups** using the `MT3_FULL_PLUS` taxonomy. Decoding is greedy (argmax) by default, with optional classifier-free guidance (CFG).
89
+ - **Inference:** audio is processed in 5-second chunks; note events are emitted in temporal order. Optional **instrument conditioning** stabilizes predictions across chunk boundaries and lets you restrict/customize the transcription (see below).
90
+
91
+ **Note on the representation:** the tokenizer recovers onset/offset timing, pitch, and instrument, but **not velocity**. It also cannot represent two notes of the same pitch and instrument sounding at the same time. Drums are onset-only.
92
+
93
+ ## Model variants
94
+
95
+ | Repo | Params | `dim` | heads | layers | Notes |
96
+ |---|---|---|---|---|---|
97
+ | [`muscriptor-small`](https://huggingface.co/MuScriptor/muscriptor-small) | β‰ˆ100M | 768 | 12 | 14 | smallest / fastest |
98
+ | [`muscriptor-medium`](https://huggingface.co/MuScriptor/muscriptor-medium) | β‰ˆ300M | 1024 | 16 | 24 | **this model** Β· good trade-off |
99
+ | [`muscriptor-large`](https://huggingface.co/MuScriptor/muscriptor-large) | β‰ˆ1.3B | 1536 | 24 | 48 | best quality |
100
+
101
+ All variants share the same input pipeline, tokenizer, and training recipe; they differ only in latent dimension, attention heads, and depth.
102
+
103
+ ## Intended uses & limitations
104
+
105
+ **Intended uses**
106
+ - General-purpose transcription of real, multi-instrument music across genres (classical β†’ heavy metal) into MIDI.
107
+ - A building block for music information retrieval (chord/key recognition), musicological analysis, generative-modeling data pipelines, and tools for musicians.
108
+
109
+ **Out of scope / use with care**
110
+ - Not a substitute for a hand-annotated score; expect errors, especially on dense mixes, unusual timbres, and heavily processed audio.
111
+ - Velocity/dynamics are **not** produced (see note above).
112
+ - Onset/offset precision is lower for some styles (e.g. choral music), and exact offsets are inherently harder than onsets.
113
+
114
+ **Limitations & biases**
115
+ - Training data skews toward pop and Western classical music, and the instrument distribution is long-tailed (piano/guitar/bass/drums are most frequent). Rare instruments and underrepresented genres may be transcribed less reliably.
116
+ - The fixed `MT3_FULL_PLUS` 36-group instrument taxonomy limits instrument granularity.
117
+ - Simultaneous same-pitch/same-instrument notes cannot be represented by the tokenizer.
118
+
119
+ ## Instrument conditioning
120
+
121
+ The model can be told which instrument groups are present in the track. Supplying the correct set improves quantitative scores and produces more coherent instrument assignments across segments.
122
+
123
+ ```python
124
+ from muscriptor.tokenizer.mt3 import MT3_FULL_PLUS_GROUP_NAMES
125
+
126
+ # `instrument_group` is a space-separated string of MT3_FULL_PLUS group IDs.
127
+ # Convert readable group names to IDs:
128
+ names = ["acoustic_piano", "acoustic_guitar", "acoustic_bass"]
129
+ instrument_group = " ".join(str(MT3_FULL_PLUS_GROUP_NAMES[n]) for n in names) # -> "0 4 7"
130
+
131
+ # Only expect piano, acoustic guitar and bass in this track:
132
+ model.transcribe_to_midi("audio.wav", instrument_group=instrument_group)
133
+ ```
134
+
135
+ ```bash
136
+ muscriptor transcribe --model medium --instruments "acoustic_piano,acoustic_guitar,acoustic_bass" audio.wav -o out.mid
137
+ muscriptor list-instruments # show all available group names
138
+ ```
139
+
140
+ ## Evaluation
141
+
142
+ Metrics are instrument-agnostic F1 scores computed with [`mir_eval`](https://github.com/craffel/mir_eval) on `D_Test`, the authors' held-out test set of 372 multi-instrument tracks.
143
+
144
+ **Model-size comparison** (F1 ↑; from the paper's scaling study, models trained on `D_Real` only, CFG = 2):
145
+
146
+ | Variant | Params | Onset | Frame | Offset | Drums | Multi |
147
+ |---|---|---|---|---|---|---|
148
+ | `muscriptor-small` | 100M | 51.2 | 67.2 | 38.7 | 41.5 | 38.2 |
149
+ | **`muscriptor-medium`** | **300M** | **52.4** | **68.0** | **40.3** | **42.0** | **39.7** |
150
+ | `muscriptor-large` | 1.3B | 53.2 | 68.7 | 41.0 | 42.5 | 40.5 |
151
+
152
+ These numbers come from the model-size ablation, which trains on real audio **only**. The **released checkpoints additionally use synthetic pre-training and RL post-training**, which improve real-world quality substantially beyond these figures. See [`muscriptor-large`](https://huggingface.co/MuScriptor/muscriptor-large) and the paper for per-dataset results.
153
+
154
+ ## Citation
155
+
156
+ ```bibtex
157
+ @inproceedings{muscriptor2026,
158
+ title = {MuScriptor: An Open Model for Multi-Instrument Music Transcription},
159
+ author = {Rouard, Simon and Krause, Michael and Roebel, Axel and
160
+ Simon-Gabriel, Carl-Johann and D{\'e}fossez, Alexandre},
161
+ year = {2026},
162
+ note = {Kyutai, Mirelo AI, IRCAM}
163
+ }
164
+ ```
165
+
166
+ <!-- TODO: replace with the final published citation (venue / arXiv id) once available. -->
167
+
168
+ ## License
169
+
170
+ Code released under the [MIT License](https://github.com/muscriptor/muscriptor/blob/main/LICENSE). Weights released under CC-BY-NC.
config.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "muscriptor",
3
+ "variant": "medium",
4
+ "dim": 1024,
5
+ "num_heads": 16,
6
+ "num_layers": 24,
7
+ "card": 1395
8
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ac80adbdf85d87231735fd948af7013441c0afced316c4e9067fd5d8a7fb97ec
3
+ size 1228144472