From 3c8c3bd5372555dff4a357cc2e68e29a57a9afe5 Mon Sep 17 00:00:00 2001 From: Robin Cole Date: Thu, 28 Nov 2024 12:08:22 +0000 Subject: [PATCH] Remove metadata --- src/litdata/streaming/serializers.py | 5 +---- tests/streaming/test_serializer.py | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/litdata/streaming/serializers.py b/src/litdata/streaming/serializers.py index db957e18..01181b2e 100644 --- a/src/litdata/streaming/serializers.py +++ b/src/litdata/streaming/serializers.py @@ -399,10 +399,7 @@ def serialize(self, item: Any) -> Tuple[bytes, Optional[str]]: with open(item, "rb") as f: data = f.read() - # Store metadata if needed - _, ext = os.path.splitext(item) - metadata = f"tifffile:{ext.lower()}" - return data, metadata + return data def deserialize(self, data: bytes) -> Any: return tifffile.imread(io.BytesIO(data)) # This is a NumPy array diff --git a/tests/streaming/test_serializer.py b/tests/streaming/test_serializer.py index 7ef829a6..97be9ec9 100644 --- a/tests/streaming/test_serializer.py +++ b/tests/streaming/test_serializer.py @@ -287,12 +287,10 @@ def test_tiff_serializer(): assert serializer.can_serialize(file_path) # Serialize - data, metadata = serializer.serialize(file_path) + data = serializer.serialize(file_path) assert isinstance(data, bytes) - assert metadata == f"tiff:{os.path.splitext(file_path)[1].lower()}" # Deserialize - serializer.setup(metadata) deserialized_data = serializer.deserialize(data) assert isinstance(deserialized_data, np.ndarray) assert deserialized_data.shape == (height, width, bands)