Skip to content

Commit ab737ea

Browse files
committed
Fix input config checks
1 parent a243522 commit ab737ea

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/omar_rq.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ def get_model(
8080
# Init representation related variables
8181
sr, hop_len, patch_size, ckpt_path = None, None, None, None
8282

83+
if config_file is not None and model_id is not None:
84+
raise ValueError("Provide either a model_id or a config_file, not both.")
85+
8386
if model_id:
8487
config_file = hf_hub_download(repo_id=model_id, filename="config.gin")
8588
ckpt_path = hf_hub_download(repo_id=model_id, filename="model.ckpt")
@@ -124,10 +127,6 @@ def get_model(
124127
)
125128

126129
if config_file != "":
127-
assert model_id is None, (
128-
"When a config file is provided, mudel_id should not be configured."
129-
)
130-
131130
# Make the checkpoint path relative to the config file location
132131
# insted of taking the absolute path
133132
if not ckpt_path:

0 commit comments

Comments
 (0)