Set num_workers=0 in Chronos-2 test data loader (#365)

By default, the `transformers` library sets the `num_workers` argument
of the PyTorch DataLoader to `0`, ensuring out-of-the-box compatibility
across different platforms.

*Issue #, if available:*

*Description of changes:*

Set the DataLoader `num_workers` argument to `0` to improve
cross-platform compatibility, particularly on Windows systems where
multiprocessing requires guarded execution.

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

---------

Co-authored-by: Abdul Fatir <Abdulfatirs@gmail.com>
This commit is contained in:
Ilias Aarab 2025-11-05 23:33:07 +01:00 committed by GitHub
parent 93419cfe9f
commit 78bd1c90ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -542,7 +542,7 @@ class Chronos2Pipeline(BaseChronosPipeline):
mode=DatasetMode.TEST,
)
test_loader = DataLoader(
test_dataset, batch_size=None, num_workers=1, pin_memory=True, shuffle=False, drop_last=False
test_dataset, batch_size=None, pin_memory=True, shuffle=False, drop_last=False
)
all_predictions: list[torch.Tensor] = []