From bbe974eb1e79720cf3fccc9ad0925a9891470c34 Mon Sep 17 00:00:00 2001 From: Khalil Meftah Date: Tue, 21 Apr 2026 14:05:02 +0200 Subject: [PATCH] fix(rewards): ensure FileNotFoundError is raised for missing config_file --- src/lerobot/configs/rewards.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lerobot/configs/rewards.py b/src/lerobot/configs/rewards.py index 226db70b6..89fc51574 100644 --- a/src/lerobot/configs/rewards.py +++ b/src/lerobot/configs/rewards.py @@ -123,14 +123,14 @@ class RewardModelConfig(draccus.ChoiceRegistry, HubMixin, abc.ABC): f"{CONFIG_NAME} not found on the HuggingFace Hub in {model_id}" ) from e + if config_file is None: + raise FileNotFoundError(f"{CONFIG_NAME} not found in {model_id}") + # HACK: Parse the original config to get the config subclass, so that we can # apply cli overrides. with draccus.config_type("json"): orig_config = draccus.parse(cls, config_file, args=[]) - if config_file is None: - raise FileNotFoundError(f"{CONFIG_NAME} not found in {model_id}") - with open(config_file) as f: config = json.load(f)