floriangardin commited on
Commit
f8addc7
1 Parent(s): 0389810

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -5
README.md CHANGED
@@ -36,15 +36,15 @@ How to use ?
36
 
37
  ```python
38
  from musiclang_predict import predict_chords, MusicLangTokenizer
39
- from transformers import GPT2LMHeadModel
40
  from musiclang.library import *
41
 
42
  # Load model and tokenizer
43
- model = GPT2LMHeadModel.from_pretrained('musiclang/musiclang-chord-v2-4k')
44
- tokenizer = MusicLangTokenizer('musiclang/musiclang-chord-v2-4k')
45
- soundtrack = predict_chords(model, tokenizer, chord_duration=4, nb_chords=2)
46
 
47
- # Gave the chord a simple voicing
48
  soundtrack = soundtrack(b0, b1, b2, b3)
49
 
50
  # Save it to midi
 
36
 
37
  ```python
38
  from musiclang_predict import predict_chords, MusicLangTokenizer
39
+ from transformers import AutoModelForCausalLM, AutoTokenizer
40
  from musiclang.library import *
41
 
42
  # Load model and tokenizer
43
+ model = AutoModelForCausalLM.from_pretrained('musiclang/musiclang-chord-v2-4k')
44
+ tokenizer = AutoTokenizer.from_pretrained('musiclang/musiclang-chord-v2-4k')
45
+ soundtrack = predict_chords(model, tokenizer, nb_chords=4, temperature=1.0)
46
 
47
+ # Give the chord a simple voicing (closed position chord)
48
  soundtrack = soundtrack(b0, b1, b2, b3)
49
 
50
  # Save it to midi