from musiclang_predict import predict, MusicLangTokenizer
from transformers import GPT2LMHeadModel
model = GPT2LMHeadModel.from_pretrained('musiclang/musiclang-4k')
tokenizer = MusicLangTokenizer('musiclang/musiclang-4k')
# Predict a 8 bar song in 4/4 time signature with this model
soundtrack = predict(model, tokenizer, chord_duration=4, nb_chords=4)
soundtrack.to_midi('song.mid', tempo=120, time_signature=(4, 4))
and I get the below error
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 8
5 tokenizer = MusicLangTokenizer('musiclang/musiclang-4k')
7 # Predict a 8 bar song in 4/4 time signature with this model
----> 8 soundtrack = predict(model, tokenizer, chord_duration=4, nb_chords=4)
9 soundtrack.to_midi('song.mid', tempo=120, time_signature=(4, 4))
TypeError: 'module' object is not callable
Any idea if I'm doing anything wrong here? I installed musiclang-predict and you can see my package versions below.
I am trying to run the example from the docs https://musiclang.readthedocs.io/en/latest/auto_examples/01_basics/04_predict_new_music.html
and I get the below error
Any idea if I'm doing anything wrong here? I installed musiclang-predict and you can see my package versions below.