Skip to content

Commit

Permalink
fixing data augmentation test to handle unique_track drum tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
Natooz committed Jul 6, 2023
1 parent 30d5546 commit c40cf35
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,14 @@ def test_data_augmentation():
):
if is_drum:
continue
for original_token, aug_token in zip(original_track, aug_track):
for idx, (original_token, aug_token) in enumerate(zip(original_track, aug_track)):
if not tokenizer.is_multi_voc:
if original_token in pitch_tokens:
assert aug_token == original_token + offsets[0]
pitch_offset = offsets[0]
# no offset for drum pitches
if tokenizer.unique_track and idx > 0 and tokenizer[original_track[idx - 1]] == "Program_-1":
pitch_offset = 0
assert aug_token == original_token + pitch_offset
elif original_token in vel_tokens:
assert aug_token in [
original_token + offsets[1],
Expand Down

0 comments on commit c40cf35

Please sign in to comment.