Natooz commited on
Commit
404733b
1 Parent(s): 6eb3e80

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 TSD
52
- from miditoolkit import MidiFile
53
 
54
  torch.set_default_device("cuda")
55
  model = AutoModelForCausalLM.from_pretrained("Natooz/Maestro-TSD-bpe20k", trust_remote_code=True, torch_dtype="auto")
56
  tokenizer = TSD.from_pretrained("Natooz/Maestro-TSD-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 TSD
52
+ from symusic import Score
53
 
54
  torch.set_default_device("cuda")
55
  model = AutoModelForCausalLM.from_pretrained("Natooz/Maestro-TSD-bpe20k", trust_remote_code=True, torch_dtype="auto")
56
  tokenizer = TSD.from_pretrained("Natooz/Maestro-TSD-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