Downloads · 30 days
192
8% of all-time downloads
musiclang/musiclang-chord-v2-4k
musiclang-chord-v2-4k is a text generation model from musiclang. Use it when you need the model to write or continue text. It is set up for transformers.
MusicLang Chord Predictor model ===============================
Downloads · 30 days
192
8% of all-time downloads
All-time downloads
2.5K
Public
Parameters
5.6M
35.3 MB on disk
Likes
7
Public
Click a slice to open those files.
.safetensors22.4 MB · 100%
From the Hugging Face model README

MusicLang Chord Predictor is a model for creating original chord scale progressions in the musiclang format with generative AI model.
It can be used for different use cases :
If you are only looking to generate chord progressions in an easily readable format, consider using our text chord predictor
To make the prediction we have an inference package available here : MusicLang Predict which is based on the musiclang language : MusicLang.
Install the musiclang-predict package with pip :
pip install musiclang-predict
from musiclang_predict import predict_chords, MusicLangTokenizer
from transformers import AutoModelForCausalLM, AutoTokenizer
from musiclang.library import *
# Load model and tokenizer
model = AutoModelForCausalLM.from_pretrained('musiclang/musiclang-chord-v2-4k')
tokenizer = AutoTokenizer.from_pretrained('musiclang/musiclang-chord-v2-4k')
soundtrack = predict_chords(model, tokenizer, nb_chords=4, temperature=1.0)
# Give the chord a simple voicing (closed position chord)
soundtrack = soundtrack(b0, b1, b2, b3)
# Save it to midi
soundtrack.to_midi('song.mid', tempo=120, time_signature=(4, 4))
from musiclang_predict import predict_chords, MusicLangTokenizer
from transformers import AutoModelForCausalLM, AutoTokenizer
from musiclang.library import *
prompt = (I % I.M) + (V % I.M)['6'].o(-1)
# Load model and tokenizer
model = GPT2LMHeadModel.from_pretrained('musiclang/musiclang-chord-v2-4k')
tokenizer = AutoTokenizer.from_pretrained('musiclang/musiclang-chord-v2-4k')
soundtrack = predict_chords(model, tokenizer, nb_chords=4, prompt=prompt)
# Give the chord a simple voicing (closed position chord)
soundtrack = soundtrack(b0, b1, b2, b3)
# Save it to midi
soundtrack.to_midi('song.mid', tempo=120, time_signature=(4, 4))
If you want to help shape the future of open source music generation, please contact us
This model is free to use for research and open source purpose only. Please credit me (Florian GARDIN) and musiclang if you do so.
If you would like to use this in a commercial product please contact us to discuss licensing terms and potential integration in your product. I am looking forward to hearing about your project !