Skip to content

Commit

Permalink
min(n_proc , ...)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro Sordoni committed Nov 12, 2024
1 parent bc14f13 commit ec885eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mttl/datamodule/mt_seq_to_seq_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ def apply_source_template(dataset, source_template):
class FlatMultiTaskModule(DataModule):
def setup_dataset(self):
self.dataset = DatasetLibrary.pull_dataset_with_retry(self.config.dataset)
n_proc = int(os.environ.get("MTTL_NUM_PROC_DATASETS", 16))
n_proc = min(
len(self.dataset), int(os.environ.get("MTTL_NUM_PROC_DATASETS", 16))
)

if "split" not in self.dataset.column_names["train"]:
logger.warning(
Expand Down

0 comments on commit ec885eb

Please sign in to comment.