Skip to content

Commit

Permalink
fix dataset token loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Fradet committed Mar 7, 2023
1 parent fa8b85f commit 02793bb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@
" midi = MidiFile(file_path)\n",
" for _ in range(len(midi.instruments) - 1):\n",
" del midi.instruments[1] # removes all tracks except first one\n",
" tokens = tokenizer.midi_to_tokens(midi)[0]\n",
" tokens = tokenizer.midi_to_tokens(midi)[0].ids\n",
" else:\n",
" with open(file_path) as json_file:\n",
" tokens = json.load(json_file)['tokens'][0] # first track\n",
" tokens = json.load(json_file)['ids'][0] # first track\n",
" i = 0\n",
" while i < len(tokens):\n",
" if i >= len(tokens) - min_seq_len:\n",
Expand Down

0 comments on commit 02793bb

Please sign in to comment.