Natooz commited on
Commit
f1e544a
1 Parent(s): f485fcb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -4
README.md CHANGED
@@ -49,17 +49,17 @@ You will need the `miditok` (>=v2.1.7), `transformers` and `torch` packages to m
49
  import torch
50
  from transformers import AutoModelForCausalLM
51
  from miditok import REMI
52
- from miditoolkit import MidiFile
53
 
54
  torch.set_default_device("cuda")
55
  model = AutoModelForCausalLM.from_pretrained("Natooz/Maestro-REMI-bpe20k", trust_remote_code=True, torch_dtype="auto")
56
  tokenizer = REMI.from_pretrained("Natooz/Maestro-REMI-bpe20k")
57
- input_midi = MidiFile("path/to/file.mid")
58
  input_tokens = tokenizer(input_midi)
59
 
60
- generated_token_ids = model.generate(input_tokens.ids, max_length=200)
61
  generated_midi = tokenizer(generated_token_ids)
62
- generated_midi.dump("path/to/continued.mid")
63
  ```
64
 
65
  ## Training Details
 
49
  import torch
50
  from transformers import AutoModelForCausalLM
51
  from miditok import REMI
52
+ from symusic import Score
53
 
54
  torch.set_default_device("cuda")
55
  model = AutoModelForCausalLM.from_pretrained("Natooz/Maestro-REMI-bpe20k", trust_remote_code=True, torch_dtype="auto")
56
  tokenizer = REMI.from_pretrained("Natooz/Maestro-REMI-bpe20k")
57
+ input_midi = Score("path/to/file.mid")
58
  input_tokens = tokenizer(input_midi)
59
 
60
+ generated_token_ids = model.generate(input_tokens.ids, max_length=500)
61
  generated_midi = tokenizer(generated_token_ids)
62
+ generated_midi.dump_midi("path/to/continued.mid")
63
  ```
64
 
65
  ## Training Details