Skip to content

Commit

Permalink
u
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyTNT committed Sep 3, 2023
1 parent 0c7a28c commit 99b79d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Pillow
numpy
torch
transformers
transformers>=4.32.1
optimum>=1.12.0
pytorch_lightning
gradio
pyfluidsynth
5 changes: 2 additions & 3 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,8 @@ def gen_example():
f.write(MIDI.score2midi(mid))
prompt = val_dataset.load_midi(random.randint(0, len(val_dataset) - 1))
prompt = np.asarray(prompt, dtype=np.int16)
start_idx = random.randrange(0, max(1, prompt.shape[0] - 256))
ori = prompt[start_idx: start_idx + 512]
prompt = prompt[start_idx: start_idx + 256].astype(np.int64)
ori = prompt[:512]
prompt = prompt[:256].astype(np.int64)
mid = self.generate(prompt)
mid = self.tokenizer.detokenize(mid)
img = self.tokenizer.midi2img(mid)
Expand Down

0 comments on commit 99b79d5

Please sign in to comment.