Prevent resuming from hub (#726)

This commit is contained in:
Simon Alibert
2025-02-13 17:15:55 +01:00
committed by GitHub
parent e71095960f
commit 1e49cc4d60

View File

@@ -85,6 +85,11 @@ class TrainPipelineConfig(HubMixin):
config_path = parser.parse_arg("config_path")
if not config_path:
raise ValueError("A config_path is expected when resuming a run.")
if not Path(config_path).resolve().exists():
raise NotADirectoryError(
f"{config_path=} is expected to be a local path. "
"Resuming from the hub is not supported for now."
)
policy_path = Path(config_path).parent
self.policy.pretrained_path = policy_path
self.checkpoint_path = policy_path.parent