floriangardin
commited on
Commit
•
f8addc7
1
Parent(s):
0389810
Update README.md
Browse files
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
|
40 |
from musiclang.library import *
|
41 |
|
42 |
# Load model and tokenizer
|
43 |
-
model =
|
44 |
-
tokenizer =
|
45 |
-
soundtrack = predict_chords(model, tokenizer,
|
46 |
|
47 |
-
#
|
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
|