Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ repos:
- id: detect-private-key

- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
rev: v2.4.2
hooks:
- id: codespell
additional_dependencies: [tomli]
Expand All @@ -55,14 +55,14 @@ repos:
#args: ["--write-changes"] # uncomment if you want to get automatic fixing

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.10
rev: v0.15.20
hooks:
- id: ruff
- id: ruff-check
args: ["--fix"]
- id: ruff-format

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.22
rev: 1.0.0
hooks:
- id: mdformat
additional_dependencies:
Expand Down Expand Up @@ -90,6 +90,6 @@ repos:
- id: pyproject-fmt
additional_dependencies: [tox]
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.24.1
rev: v0.25
hooks:
- id: validate-pyproject
8 changes: 2 additions & 6 deletions tests/streaming/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1616,16 +1616,13 @@ def test_dataset_with_mosaic_mds_data(tmpdir):

dataset = StreamingDataset(input_dir=str(tmpdir))
dataloader = DataLoader(dataset, batch_size=4, drop_last=True)
i = 0
for batch in dataloader:
for i, batch in enumerate(dataloader):
assert len(batch["class"]) == 4
assert len(batch["image"]) == 4
assert list(batch["class"]) == [4 * i, 4 * i + 1, 4 * i + 2, 4 * i + 3]
i += 1

dataloader = DataLoader(dataset, batch_size=4, drop_last=False)
i = 0
for batch in dataloader:
for i, batch in enumerate(dataloader):
if i == 2:
# last batch is smaller than batch_size
assert len(batch["class"]) == 2
Expand All @@ -1635,7 +1632,6 @@ def test_dataset_with_mosaic_mds_data(tmpdir):
assert len(batch["class"]) == 4
assert len(batch["image"]) == 4
assert list(batch["class"]) == [4 * i, 4 * i + 1, 4 * i + 2, 4 * i + 3]
i += 1


@pytest.mark.parametrize("shuffle", [True, False])
Expand Down
Loading