Downloads · 30 days
100
6% of all-time downloads
NathanFradet/Maestro-TSD-bpe20k
Maestro-TSD-bpe20k is a text generation model from NathanFradet. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This is a generative model from the paper "Byte Pair Encoding for Symbolic Music" (EMNLP 2023). The model has been trained with Byte Pair Encoding (BPE) on the Maestro dataset to generate classical piano music with th…
Downloads · 30 days
100
6% of all-time downloads
All-time downloads
1.8K
Public
Parameters
49.1M
197 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors196 MB · 99%
From the Hugging Face model README
This is a generative model from the paper "Byte Pair Encoding for Symbolic Music" (EMNLP 2023). The model has been trained with Byte Pair Encoding (BPE) on the Maestro dataset to generate classical piano music with the TSD tokenizer.
It has a vocabulary of 20k tokens learned with Byte Pair Encoding (BPE) using MidiTok.
The model is designed for autoregressive music generation. It generates the continuation of a music prompt.
Use the code below to get started with the model.
You will need the miditok (>=v2.1.7), transformers and torch packages to make it run, that can be installed with pip.
import torch
from transformers import AutoModelForCausalLM
from miditok import TSD
from symusic import Score
torch.set_default_device("cuda")
model = AutoModelForCausalLM.from_pretrained("Natooz/Maestro-TSD-bpe20k", trust_remote_code=True, torch_dtype="auto")
tokenizer = TSD.from_pretrained("Natooz/Maestro-TSD-bpe20k")
input_midi = Score("path/to/file.mid")
input_tokens = tokenizer(input_midi)
generated_token_ids = model.generate(input_tokens.ids, max_length=500)
generated_midi = tokenizer(generated_token_ids)
generated_midi.dump_midi("path/to/continued.mid")
The model has been trained on the Maestro dataset. The dataset contains about 200 hours of classical piano music. The tokenizer is trained with Byte Pair Encoding (BPE) to build a vocabulary of 20k tokens.
The following hyperparameters were used during training:
We cannot estimate reliably the amount of CO2eq emitted, as we lack data on the exact power source used during training. However, we can highlight that the cluster used is mostly powered by nuclear energy, which is a low carbon energy source ensuring a reduced direct environmental impact.
BibTeX:
@inproceedings{bpe-symbolic-music,
title = "Byte Pair Encoding for Symbolic Music",
author = "Fradet, Nathan and
Gutowski, Nicolas and
Chhel, Fabien and
Briot, Jean-Pierre",
editor = "Bouamor, Houda and
Pino, Juan and
Bali, Kalika",
booktitle = "Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing",
month = dec,
year = "2023",
address = "Singapore",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2023.emnlp-main.123",
doi = "10.18653/v1/2023.emnlp-main.123",
pages = "2001--2020",
}