AEmotionStudio commited on
Commit
eee77f7
·
verified ·
1 Parent(s): 3edb84d

Mirror slseanwu/MIDI-LLM_Llama-3.2-1B @ 8b82ab9ec144 for MAESTRO

Browse files

- model.safetensors VERBATIM (bf16, sha256-checked against upstream LFS metadata)
- tokenizer files bundled for fully-offline runtime
- LICENSE.md: the Llama 3.2 Community License, as required for redistribution
- README carries the mandatory 'Built with Llama' notice
- structural verify (config + safetensors header: 183286-token vocab, bf16) before upload

Loaded by MAESTRO via backend/ai/models/midi_llm.py.

.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* 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
 
 
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
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
LICENSE.md ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ LLAMA 3.2 COMMUNITY LICENSE AGREEMENT
2
+
3
+ Llama 3.2 Version Release Date: September 25, 2024
4
+
5
+ “Agreement” means the terms and conditions for use, reproduction, distribution and modification of the Llama Materials set forth herein.
6
+
7
+ “Documentation” means the specifications, manuals and documentation accompanying Llama 3.2 distributed by Meta at https://llama.com/docs/overview.
8
+
9
+ “Licensee” or “you” means you, or your employer or any other person or entity (if you are entering into this Agreement on such person or entity’s behalf), of the age required under applicable laws, rules or regulations to provide legal consent and that has legal authority to bind your employer or such other person or entity if you are entering in this Agreement on their behalf.
10
+
11
+ “Llama 3.2” means the foundational large language models and software and algorithms, including machine-learning model code, trained model weights, inference-enabling code, training-enabling code, fine-tuning enabling code and other elements of the foregoing distributed by Meta at https://llama.com/llama-downloads.
12
+
13
+ “Llama Materials” means, collectively, Meta’s proprietary Llama 3.2 and Documentation (and any portion thereof) made available under this Agreement.
14
+
15
+ “Meta” or “we” means Meta Platforms Ireland Limited (if you are located in or, if you are an entity, your principal place of business is in the EEA or Switzerland) and Meta Platforms, Inc. (if you are located outside of the EEA or Switzerland).
16
+
17
+ By clicking “I Accept” below or by using or distributing any portion or element of the Llama Materials, you agree to be bound by this Agreement.
18
+
19
+ 1. License Rights and Redistribution.
20
+
21
+ a. Grant of Rights. You are granted a non-exclusive, worldwide, non-transferable and royalty-free limited license under Meta’s intellectual property or other rights owned by Meta embodied in the Llama Materials to use, reproduce, distribute, copy, create derivative works of, and make modifications to the Llama Materials.
22
+
23
+ b. Redistribution and Use.
24
+
25
+ i. If you distribute or make available the Llama Materials (or any derivative works thereof), or a product or service (including another AI model) that contains any of them, you shall (A) provide a copy of this Agreement with any such Llama Materials; and (B) prominently display “Built with Llama” on a related website, user interface, blogpost, about page, or product documentation. If you use the Llama Materials or any outputs or results of the Llama Materials to create, train, fine tune, or otherwise improve an AI model, which is distributed or made available, you shall also include “Llama” at the beginning of any such AI model name.
26
+
27
+ ii. If you receive Llama Materials, or any derivative works thereof, from a Licensee as part of an integrated end user product, then Section 2 of this Agreement will not apply to you.
28
+
29
+ iii. You must retain in all copies of the Llama Materials that you distribute the following attribution notice within a “Notice” text file distributed as a part of such copies: “Llama 3.2 is licensed under the Llama 3.2 Community License, Copyright © Meta Platforms, Inc. All Rights Reserved.”
30
+
31
+ iv. Your use of the Llama Materials must comply with applicable laws and regulations (including trade compliance laws and regulations) and adhere to the Acceptable Use Policy for the Llama Materials (available at https://llama.com/llama3_2/use-policy), which is hereby incorporated by reference into this Agreement.
32
+
33
+ 2. Additional Commercial Terms. If, on the Llama 3.2 version release date, the monthly active users of the products or services made available by or for Licensee, or Licensee’s affiliates, is greater than 700 million monthly active users in the preceding calendar month, you must request a license from Meta, which Meta may grant to you in its sole discretion, and you are not authorized to exercise any of the rights under this Agreement unless or until Meta otherwise expressly grants you such rights.
34
+
35
+ 3. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE LLAMA MATERIALS AND ANY OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OF ANY KIND, AND META DISCLAIMS ALL WARRANTIES OF ANY KIND, BOTH EXPRESS AND IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING THE LLAMA MATERIALS AND ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE LLAMA MATERIALS AND ANY OUTPUT AND RESULTS.
36
+
37
+ 4. Limitation of Liability. IN NO EVENT WILL META OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS OR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF META OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF ANY OF THE FOREGOING.
38
+
39
+ 5. Intellectual Property.
40
+
41
+ a. No trademark licenses are granted under this Agreement, and in connection with the Llama Materials, neither Meta nor Licensee may use any name or mark owned by or associated with the other or any of its affiliates, except as required for reasonable and customary use in describing and redistributing the Llama Materials or as set forth in this Section 5(a). Meta hereby grants you a license to use “Llama” (the “Mark”) solely as required to comply with the last sentence of Section 1.b.i. You will comply with Meta’s brand guidelines (currently accessible at https://about.meta.com/brand/resources/meta/company-brand/). All goodwill arising out of your use of the Mark will inure to the benefit of Meta.
42
+
43
+ b. Subject to Meta’s ownership of Llama Materials and derivatives made by or for Meta, with respect to any derivative works and modifications of the Llama Materials that are made by you, as between you and Meta, you are and will be the owner of such derivative works and modifications.
44
+
45
+ c. If you institute litigation or other proceedings against Meta or any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Llama Materials or Llama 3.2 outputs or results, or any portion of any of the foregoing, constitutes infringement of intellectual property or other rights owned or licensable by you, then any licenses granted to you under this Agreement shall terminate as of the date such litigation or claim is filed or instituted. You will indemnify and hold harmless Meta from and against any claim by any third party arising out of or related to your use or distribution of the Llama Materials.
46
+
47
+ 6. Term and Termination. The term of this Agreement will commence upon your acceptance of this Agreement or access to the Llama Materials and will continue in full force and effect until terminated in accordance with the terms and conditions herein. Meta may terminate this Agreement if you are in breach of any term or condition of this Agreement. Upon termination of this Agreement, you shall delete and cease use of the Llama Materials. Sections 3, 4 and 7 shall survive the termination of this Agreement.
48
+
49
+ 7. Governing Law and Jurisdiction. This Agreement will be governed and construed under the laws of the State of California without regard to choice of law principles, and the UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement. The courts of California shall have exclusive jurisdiction of any dispute arising out of this Agreement.
README.md ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: llama3.2
3
+ base_model: meta-llama/Llama-3.2-1B
4
+ tags:
5
+ - music
6
+ - midi
7
+ - text-to-midi
8
+ - symbolic-music
9
+ - maestro
10
+ - llama
11
+ ---
12
+
13
+ # MIDI-LLM — MAESTRO mirror
14
+
15
+ **Built with Llama.**
16
+
17
+ Verbatim mirror of [`slseanwu/MIDI-LLM_Llama-3.2-1B`](https://huggingface.co/slseanwu/MIDI-LLM_Llama-3.2-1B)
18
+ (revision `8b82ab9e`) for the [MAESTRO](https://github.com/AEmotionStudio) audio workstation's
19
+ **MIDI-LLM** panel — text → multi-instrument General-MIDI generation, landing in the piano roll as one
20
+ pattern per instrument.
21
+
22
+ MIDI-LLM (Shih-Lun Wu et al., ISMIR 2026 — code at
23
+ [slSeanWU/MIDI-LLM](https://github.com/slSeanWU/MIDI-LLM)) is **Llama-3.2-1B** whose vocabulary is
24
+ extended with the 55 030 [Anticipatory Music Transformer](https://github.com/jthickstun/anticipation)
25
+ MIDI tokens (onset time, duration, instrument-pitch triplets at 10 ms resolution). It was continued-pretrained
26
+ on MusicPile + GigaMIDI and fine-tuned on Lakh MIDI paired with MidiCaps captions.
27
+
28
+ ## Files
29
+
30
+ | File | Notes |
31
+ |---|---|
32
+ | `model.safetensors` | 1.47 B parameters, bf16, **unchanged** — sha256 matches the upstream LFS object |
33
+ | `config.json`, `generation_config.json` | `LlamaForCausalLM`, `vocab_size` 183 286 = 128 256 text + 55 030 MIDI |
34
+ | `tokenizer.json`, `tokenizer_config.json`, `special_tokens_map.json` | upstream tokenizer, unchanged |
35
+ | `LICENSE.md` | the Llama 3.2 Community License, reproduced as the license requires |
36
+ | `sha256.json` | digest of every shipped file |
37
+
38
+ Nothing is converted or quantised. MAESTRO loads the checkpoint with plain `transformers`
39
+ (`AutoModelForCausalLM`, bf16, no remote code) via `backend/ai/models/midi_llm.py` and decodes the
40
+ MIDI tokens with an in-tree tolerant parser (`backend/ai/midi_llm/`), so no `anticipation` install is needed.
41
+
42
+ ## Prompting
43
+
44
+ Inference follows upstream `generate_transformers.py`: the text
45
+ `"You are a world-class composer. Please compose some music according to the following description: <your text> "`
46
+ is tokenized, the MIDI begin token (`128256 + 55026`) is appended, and the model samples MIDI tokens
47
+ (temperature 1.0, top-p 0.98, up to 2 046 new tokens ≈ 680 notes). Describe the music the way MidiCaps
48
+ captions read — genre, mood, instruments by General-MIDI name, key, time signature, tempo feel, a chord
49
+ progression.
50
+
51
+ ## License
52
+
53
+ The weights are subject to the **[Llama 3.2 Community License Agreement](https://www.llama.com/llama3_2/license/)**
54
+ (a copy ships here as `LICENSE.md`). Redistribution and products built on it must display
55
+ **"Built with Llama"** and include the license; commercial use is permitted below the 700 M monthly-active-user
56
+ threshold; the Acceptable Use Policy applies. This mirror adds nothing of its own and claims no additional rights.
57
+
58
+ The tokenization scheme is the Anticipatory Music Transformer (John Thickstun et al., Apache-2.0).
59
+
60
+ ## Citation
61
+
62
+ ```bibtex
63
+ @inproceedings{wu2026midillm,
64
+ title = {MIDI-LLM: Adapting Large Language Models for Text-to-MIDI Music Generation},
65
+ author = {Wu, Shih-Lun and others},
66
+ booktitle = {Proceedings of the International Society for Music Information Retrieval Conference (ISMIR)},
67
+ year = {2026}
68
+ }
69
+ ```
config.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "meta-llama/Llama-3.2-1B",
3
+ "architectures": [
4
+ "LlamaForCausalLM"
5
+ ],
6
+ "attention_bias": false,
7
+ "attention_dropout": 0.0,
8
+ "bos_token_id": 128000,
9
+ "eos_token_id": 128001,
10
+ "head_dim": 64,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 2048,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 8192,
15
+ "max_position_embeddings": 131072,
16
+ "mlp_bias": false,
17
+ "model_type": "llama",
18
+ "num_attention_heads": 32,
19
+ "num_hidden_layers": 16,
20
+ "num_key_value_heads": 8,
21
+ "pretraining_tp": 1,
22
+ "rms_norm_eps": 1e-05,
23
+ "rope_scaling": {
24
+ "factor": 32.0,
25
+ "high_freq_factor": 4.0,
26
+ "low_freq_factor": 1.0,
27
+ "original_max_position_embeddings": 8192,
28
+ "rope_type": "llama3"
29
+ },
30
+ "rope_theta": 500000.0,
31
+ "tie_word_embeddings": false,
32
+ "torch_dtype": "bfloat16",
33
+ "transformers_version": "4.46.2",
34
+ "use_cache": true,
35
+ "vocab_size": 183286,
36
+ "pad_token_id": 128001
37
+ }
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_sample": true,
3
+ "temperature": 1.0,
4
+ "top_p": 0.98,
5
+ "max_new_tokens": 2046,
6
+ "pad_token_id": 128001,
7
+ "eos_token_id": 128001,
8
+ "bos_token_id": 128000,
9
+ "transformers_version": "4.46.2"
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7da7f50fefa027208121661c799d3bde2a7c04ad01d40a3d4a597be3fdcaf2ae
3
+ size 3447788104
sha256.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "LICENSE.md": "55855947350905dc04264da7ebae8822ee01a833f077617a4b4b5da8b01ec2cd",
3
+ "config.json": "43a3481108356db8621ca2ea509ec296f825cb8fc011f39fd34fe52d17289400",
4
+ "generation_config.json": "0b59c8117e23d7fb95a35434cef1ee083ec40592e4c1adea0bda39ad918aa1fe",
5
+ "model.safetensors": "7da7f50fefa027208121661c799d3bde2a7c04ad01d40a3d4a597be3fdcaf2ae",
6
+ "special_tokens_map.json": "e0efa7e2ae77cb41f99df90af8ca88cdfefca5c8a57438ba321606756ac76c66",
7
+ "tokenizer.json": "9b09f7a719e9ac35dde4eb7b220990b17087dcdcb3a813aa5a90dd08978d8a91",
8
+ "tokenizer_config.json": "45af9bccb2bbef93fcb85f8528b838c9ddd95baf6a204a7af98fc2bf1f7e56df"
9
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|begin_of_text|>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|end_of_text|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ }
16
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9b09f7a719e9ac35dde4eb7b220990b17087dcdcb3a813aa5a90dd08978d8a91
3
+ size 18197173
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff