mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-26 19:26:16 +00:00
fix(rewards): ensure FileNotFoundError is raised for missing config_file
This commit is contained in:
@@ -123,14 +123,14 @@ class RewardModelConfig(draccus.ChoiceRegistry, HubMixin, abc.ABC):
|
|||||||
f"{CONFIG_NAME} not found on the HuggingFace Hub in {model_id}"
|
f"{CONFIG_NAME} not found on the HuggingFace Hub in {model_id}"
|
||||||
) from e
|
) 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
|
# HACK: Parse the original config to get the config subclass, so that we can
|
||||||
# apply cli overrides.
|
# apply cli overrides.
|
||||||
with draccus.config_type("json"):
|
with draccus.config_type("json"):
|
||||||
orig_config = draccus.parse(cls, config_file, args=[])
|
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:
|
with open(config_file) as f:
|
||||||
config = json.load(f)
|
config = json.load(f)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user