Skip to content

Commit 7fcc128

Browse files
authored
Fix model path assertion to allow HuggingFace model IDs (#448)
## Summary `load_gr00t_policy_from_config in gr00t_core.py` asserted that model_path must exist as a local filesystem path, which rejected valid HuggingFace Hub model IDs (e.g. nvidia/GR00T-N1.6-DROID).
1 parent 87bb7a0 commit 7fcc128

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

isaaclab_arena_gr00t/policy/gr00t_core.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ def load_gr00t_policy_from_config(policy_config: Gr00tClosedloopPolicyConfig) ->
9494
Raises:
9595
AssertionError: If ``policy_config.model_path`` does not exist.
9696
"""
97-
assert Path(policy_config.model_path).exists(), f"Model path {policy_config.model_path} does not exist"
97+
model_path = policy_config.model_path
98+
# HuggingFace Hub repo IDs use "owner/repo" format (e.g. "nvidia/GR00T-N1.6-DROID").
99+
is_hf_id = bool(model_path and "/" in model_path and not model_path.startswith(("/", ".")))
100+
assert (
101+
Path(model_path).exists() or is_hf_id
102+
), f"Model path {model_path} does not exist and is not a HuggingFace model id"
98103
return Gr00tPolicy(
99104
model_path=policy_config.model_path,
100105
embodiment_tag=EmbodimentTag[policy_config.embodiment_tag],

0 commit comments

Comments
 (0)