anusfoil commited on
Commit
7cf2dee
·
0 Parent(s):

Add model weights and model card

Browse files
Files changed (3) hide show
  1. .gitattributes +35 -0
  2. README.md +78 -0
  3. majeppa.safetensors +3 -0
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ tags:
6
+ - music
7
+ - MIDI
8
+ - piano
9
+ - representation-learning
10
+ - jepa
11
+ base_model: loubb/aria-medium
12
+ ---
13
+
14
+ # MAJEPPA
15
+
16
+ MAJEPPA generates and embeds solo-piano performance MIDI. It adapts the pre-trained MIDI model [Aria-medium](https://huggingface.co/loubb/aria-medium) with LoRA. Training combines score-conditioned next-token prediction with contrastive losses between score and performance embeddings.
17
+
18
+ - Paper: *MAJEPPA: Morphing and Assessing in a Unified Piano Performance Space* (ISMIR 2026, [arXiv 2608.11026](https://arxiv.org/abs/2608.11026))
19
+ - Demo and code: [interactive generation Space](https://huggingface.co/spaces/anonymous-music/majeppa-jepa-demo)
20
+ - Benchmark: [EVPMR](https://github.com/kkwsts/evpmr)
21
+ - Data: [MAJEPPA dataset](https://huggingface.co/datasets/kkwsts/MAJEPPA-Dataset)
22
+
23
+ ## Model details
24
+
25
+ - Base model: `loubb/aria-medium`, 660M parameters, frozen. The loader pins commit `5a1ef36`.
26
+ - LoRA: rank 128, alpha 32, rank-stabilised scaling, on `mixed_qkv` and `att_proj_linear`.
27
+ - New tokens with trained embeddings: 6 performer tags, 7 recording tags, 2 "unknown" tags and 1 `[PRED]` token. The LM head keeps the base vocabulary, so the model does not sample these tokens.
28
+ - Projection head: linear, 1536 to 512. Only the contrastive losses use it.
29
+ - Losses: γ=1, λ=8, β=1, α=1, τ=0.07.
30
+ - Training data: 74,060 score-performance segment pairs from the MAJEPPA dataset, of which 1,486 form the validation set. Each view holds at most 1,200 tokens.
31
+ - Training: 120 epochs, 2× H100 80 GB, batch 16 per GPU, gradient accumulation 4. This file holds the weights after the last epoch.
32
+
33
+ `majeppa.safetensors` (79 MB) holds the LoRA weights, the 16 new token rows and the projection head. Its metadata holds the configuration. The loader adds the tensors to the base model, checks that every tensor matches a parameter, and merges the LoRA weights.
34
+
35
+ ## Use
36
+
37
+ The loading and generation code is in the demo Space.
38
+
39
+ ```bash
40
+ git clone https://huggingface.co/spaces/anonymous-music/majeppa-jepa-demo majeppa-demo
41
+ cd majeppa-demo
42
+ pip install torch==2.8.0 transformers==4.49.0 peft==0.18.1 safetensors huggingface_hub "numpy<2" mido
43
+ ```
44
+
45
+ Run Python from that folder. It holds a copy of the Aria tokenizer package (`ariautils`).
46
+
47
+ ```python
48
+ from huggingface_hub import hf_hub_download
49
+ from inference import MajeppaInference
50
+
51
+ engine = MajeppaInference(hf_hub_download("anusfoil/majeppa", "majeppa.safetensors"))
52
+
53
+ # Embedding: mean of the last-block states (before the final layer norm) over the tokens of the file.
54
+ emb = engine.model.embed_file("examples/05_burgmuller_consolation.mid", max_content_len=4096) # (1536,)
55
+
56
+ # Generation: score MIDI in, performance MIDI out.
57
+ path = engine.generate("examples/04_czerny_op740_no8.mid", "piano_teacher", "slow_demo", seed=0)
58
+ ```
59
+
60
+ - The embedding leaves out Aria's `<D>` token, which the tokenizer otherwise puts at a random place. So the embedding is deterministic. `embed_file` truncates a file to `max_content_len` tokens.
61
+ - Performer types: `child_beginner`, `adult_beginner`, `adult_intermediate`, `child_professional`, `piano_teacher`, `virtuoso`.
62
+ - Recording types: `practice`, `sight_read`, `performance`, `demo_class`, `slow_demo`, `concert_performance`.
63
+ - Generation uses the training prompt `[score; EOS; COND_performer; COND_recording; PRED; prefix; <S>]`, temperature 0.8 and top-k 50. An end token is rejected until the output holds 80% of the score's notes.
64
+
65
+ ## Intended use
66
+
67
+ Non-commercial research on symbolic piano performance. See the paper for the evaluation protocol and limitations.
68
+
69
+ ## Citation
70
+
71
+ ```bibtex
72
+ @inproceedings{zhou2026majeppa,
73
+ title = {MAJEPPA: Morphing and Assessing in a Unified Piano Performance Space},
74
+ author = {Zhou, Jinwen and Zhang, Huan and Zhai, Weixi and Liang, Jinhua and Hogg, Aidan O. T. and Dixon, Simon},
75
+ booktitle = {Proc. International Society for Music Information Retrieval Conference (ISMIR)},
76
+ year = {2026}
77
+ }
78
+ ```
majeppa.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ef1af985c5b5c1a7b9c48f2883d96a09a8cc99cfa0cfbb7c5f16bc52bc44792b
3
+ size 78752272