Skip to content

Commit

Permalink
improve sample api metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
loubbrad committed Jan 24, 2024
1 parent b9a64f9 commit 882cf2f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
7 changes: 5 additions & 2 deletions aria/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,12 @@ def sample(args):

manual_metadata = {k: v for k, v in args.metadata} if args.metadata else {}
valid_metadata = load_config()["data"]["metadata"]["manual"]
for k, v in manual_metadata.items():
for k, v in manual_metadata.copy().items():
assert k in valid_metadata.keys(), f"{manual_metadata} is invalid"
assert v in valid_metadata[k], f"{manual_metadata} is invalid"
if v not in valid_metadata[k]:
print(f"Ignoring invalid manual metadata: {k}")
print(f"Please choose from {valid_metadata[k]}")
del manual_metadata[k]

num_variations = args.var
truncate_len = args.trunc
Expand Down
3 changes: 2 additions & 1 deletion config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
},
"manual": {
"genre": ["classical", "jazz"],
"form": ["sonata", "prelude", "nocturne", "étude", "waltz", "mazurka", "impromptu", "fugue"]
"form": ["sonata", "prelude", "nocturne", "étude", "waltz", "mazurka", "impromptu", "fugue"],
"composer": ["bach", "beethoven", "mozart", "chopin", "rachmaninoff", "liszt", "debussy", "schubert", "brahms", "ravel", "satie", "scarlatti"]
}
}
},
Expand Down
9 changes: 0 additions & 9 deletions config/models/large.json

This file was deleted.

0 comments on commit 882cf2f

Please sign in to comment.