[Fix] Fix the path resolve issue in windows
Fix: Fix the path resolve issue in Windows
What this does
This PR fixes a path-resolution issue on Windows by ensuring that pretrained_path is kept as a string rather than converted to a Path object.
Using Path() caused backslash/forward-slash inconsistencies, especially when handling HuggingFace repo IDs.
The fix ensures consistent forward-slash formatting across platforms.
How it was tested
- Updated
eval.pyandtrain.pyto avoid usingPath()forpretrained_pathwhere forward-slash preservation is required. - Verified that Windows paths resolve correctly when loading configs.
- Ran local training/eval runs on Windows to ensure no regressions during config loading.
How to checkout & try? (for the reviewer)
To test the behavior locally run a training command that loads a pretrained policy:
lerobot-train --config-path=path/to/config.yaml
This kinda because the path in the window will use the \\ for path; if we use the path object, this will always make the HuggingFace repo invalid to resolve. So a better way is that we keep them in posix style string to ensure all the paths create by train and resolve by train in posix style!
Ahhh I ran into this too. https://github.com/huggingface/lerobot/issues/2552