Merge branch 'main' into user/michel-aractingi/2025_06_30_dataset_v3

Signed-off-by: Michel Aractingi <michel.aractingi@huggingface.co>
This commit is contained in:
Michel Aractingi
2025-07-15 21:40:22 +02:00
138 changed files with 6032 additions and 939 deletions
+16
View File
@@ -1,3 +1,19 @@
#!/usr/bin/env python
# Copyright 2025 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import pytest
from lerobot.utils.encoding_utils import (
+16
View File
@@ -18,6 +18,8 @@ import threading
import time
from queue import Queue
from torch.multiprocessing import Queue as TorchMPQueue
from lerobot.utils.queue import get_last_item_from_queue
@@ -46,6 +48,20 @@ def test_get_last_item_multiple_items():
assert queue.empty()
def test_get_last_item_multiple_items_with_torch_queue():
"""Test getting the last item when queue has multiple items."""
queue = TorchMPQueue()
items = ["first", "second", "third", "fourth", "last"]
for item in items:
queue.put(item)
result = get_last_item_from_queue(queue)
assert result == "last"
assert queue.empty()
def test_get_last_item_different_types():
"""Test with different data types in the queue."""
queue = Queue()
+1 -1
View File
@@ -15,7 +15,7 @@
# limitations under the License.
import sys
from typing import Callable
from collections.abc import Callable
import pytest
import torch