IBM / unitxt

🦄 Unitxt: a python library for getting data fired up and set for training and evaluation
https://unitxt.rtfd.io
Apache License 2.0
139 stars 29 forks source link

added num_proc parameter for parallel data loading #974

Closed csrajmohan closed 4 days ago

csrajmohan commented 4 days ago

This adds support to pass an optional num_proc parameter in Unitxt loader so that it can be passed onto hf_load_dataset method of Huggingface Datasets library for parallel dataset loading.

p.s.: The num_proc parameter is used to specify the number of processes to use for multiprocessing in the Hugging Face datasets library. This can speed up operations while loading large datasets. (Tested with wikitq dataset)

csrajmohan commented 4 days ago

Added to LoadHF right now, but can also be added to few other Unitxt loaders like LoadFromIBMCloud, LoadFromSklearn, LoadFromKaggle that invoke hf_load_dataset, if needed.

codecov[bot] commented 4 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.04%. Comparing base (4d3ea8e) to head (cf3aaa3). Report is 1 commits behind head on main.

:exclamation: Current head cf3aaa3 differs from pull request most recent head 8a4c149

Please upload reports for the commit 8a4c149 to get more accurate results.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #974 +/- ## ======================================= Coverage 91.03% 91.04% ======================================= Files 110 110 Lines 11841 11843 +2 ======================================= + Hits 10780 10782 +2 Misses 1061 1061 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.