Skip to content

Commit 44f9b21

Browse files
authored
LerobotDataset pushable to HF from any folder (#563)
1 parent 03f49ce commit 44f9b21

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lerobot/common/datasets/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
16+
import importlib.resources
1617
import json
1718
import logging
1819
import textwrap
@@ -476,6 +477,8 @@ def create_lerobot_dataset_card(
476477
Note: If specified, license must be one of https://huggingface.co/docs/hub/repositories-licenses.
477478
"""
478479
card_tags = ["LeRobot"]
480+
card_template_path = importlib.resources.path("lerobot.common.datasets", "card_template.md")
481+
479482
if tags:
480483
card_tags += tags
481484
if dataset_info:
@@ -493,8 +496,9 @@ def create_lerobot_dataset_card(
493496
}
494497
],
495498
)
499+
496500
return DatasetCard.from_template(
497501
card_data=card_data,
498-
template_path="./lerobot/common/datasets/card_template.md",
502+
template_path=str(card_template_path),
499503
**kwargs,
500504
)

0 commit comments

Comments
 (0)