-
Notifications
You must be signed in to change notification settings - Fork 5.3k
fix: update root/repo_id path in lerobot_dataset.py
#1057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 22 commits
b301e35
808464c
f904479
9038d8c
4ed34c7
b03067b
da0f958
33a7420
f913fdf
35ea4ed
d5b112b
af2b250
8fb30ff
847de0c
0e54b2c
e71dff8
c21dab0
04fb2a7
e200a97
4b2db07
b92cb68
ef57da2
1217729
76d23ea
17a4b95
4f804db
bc0f932
68b48e3
5759270
5a5bf81
888e6ae
185b5e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -86,7 +86,7 @@ def __init__( | |||||||
| ): | ||||||||
| self.repo_id = repo_id | ||||||||
| self.revision = revision if revision else CODEBASE_VERSION | ||||||||
| self.root = Path(root) if root is not None else HF_LEROBOT_HOME / repo_id | ||||||||
| self.root = Path(root) / repo_id if root is not None else HF_LEROBOT_HOME / repo_id | ||||||||
|
|
||||||||
| try: | ||||||||
| if force_cache_sync: | ||||||||
|
|
@@ -309,7 +309,7 @@ def create( | |||||||
| """Creates metadata for a LeRobotDataset.""" | ||||||||
| obj = cls.__new__(cls) | ||||||||
| obj.repo_id = repo_id | ||||||||
| obj.root = Path(root) if root is not None else HF_LEROBOT_HOME / repo_id | ||||||||
| obj.root = Path(root) / repo_id if root is not None else HF_LEROBOT_HOME / repo_id | ||||||||
|
||||||||
| obj.root = Path(root) / repo_id if root is not None else HF_LEROBOT_HOME / repo_id | |
| sanitized_repo_id = repo_id.replace("/", "_") | |
| obj.root = Path(root) / sanitized_repo_id if root is not None else HF_LEROBOT_HOME / sanitized_repo_id |
Copilot
AI
Jul 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same path concatenation issue: Path(root) / repo_id will create nested directories when repo_id contains forward slashes. This creates inconsistency with how paths are expected to be structured based on the PR description which mentions datasets should be at ./my_local_data_dir/lerobot/pusht.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
rootis a string,Path(root) / repo_idwill fail ifrepo_idcontains a forward slash (e.g., 'lerobot/pusht'). The path concatenation should handle this case properly by usingPath(root) / Path(repo_id).nameor similar approach to avoid creating invalid nested directory structures.