Skip to content

Commit

Permalink
Add distinction between two unallowed cases in name check "eval_" (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
J4nn1K authored Nov 22, 2024
1 parent 20f4667 commit 975c1c2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lerobot/common/robot_devices/control_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,15 @@ def sanity_check_dataset_name(repo_id, policy):
_, dataset_name = repo_id.split("/")
# either repo_id doesnt start with "eval_" and there is no policy
# or repo_id starts with "eval_" and there is a policy
if dataset_name.startswith("eval_") == (policy is None):

# Check if dataset_name starts with "eval_" but policy is missing
if dataset_name.startswith("eval_") and policy is None:
raise ValueError(
f"Your dataset name begins with 'eval_' ({dataset_name}), but no policy is provided."
)

# Check if dataset_name does not start with "eval_" but policy is provided
if not dataset_name.startswith("eval_") and policy is not None:
raise ValueError(
f"Your dataset name begins by 'eval_' ({dataset_name}) but no policy is provided ({policy})."
f"Your dataset name does not begin with 'eval_' ({dataset_name}), but a policy is provided ({policy})."
)

0 comments on commit 975c1c2

Please sign in to comment.