Downloads · 30 days
42
4% of all-time downloads
shikhr/music_maker
music_maker is a audio-to-audio model from shikhr. Use it for the audio-to-audio task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
MusicMaker is a transformer-based model trained to generate novel musical compositions in the MIDI format. By learning from a dataset of piano MIDI files, the model can capture the intricate patterns and structures pr…
Downloads · 30 days
42
4% of all-time downloads
All-time downloads
1.1K
Public
Parameters
44.4M
355 MB on disk
Likes
4
Public
Click a slice to open those files.
.bin178 MB · 50%
From the Hugging Face model README
MusicMaker is a transformer-based model trained to generate novel musical compositions in the MIDI format. By learning from a dataset of piano MIDI files, the model can capture the intricate patterns and structures present in music and generate coherent and creative melodies.
The model was trained on a dataset of ~11,000 piano MIDI files from the "adl-piano-midi" collection.
from transformers import AutoModel
from miditok import MusicTokenizer
import torch
device = 'cuda' if torch.cuda.is_available() else 'cpu'
tokenizer = MusicTokenizer.from_pretrained('shikhr/music_maker')
model = AutoModel.from_pretrained('shikhr/music_maker', trust_remote_code=True)
model.to(device)
# Generate some music
out = model.generate(
torch.tensor([[1]]).to(device), max_new_tokens=400, temperature=1.0, top_k=None
)
# Save the generated MIDI
tokenizer(out[0].tolist()).dump_midi("generated.mid")