Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Passing meta to map_partitions for read_data #291

Closed
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
4 changes: 4 additions & 0 deletions nemo_curator/utils/distributed_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,9 @@ def read_data(
]
else:
input_files = [[file] for file in input_files]

meta_as_kwarg = {"meta": input_meta} if input_meta is not None else dict()

return dd.from_map(
read_single_partition,
input_files,
Expand All @@ -355,6 +358,7 @@ def read_data(
add_filename=add_filename,
input_meta=input_meta,
enforce_metadata=False,
**meta_as_kwarg,
)
else:
raise RuntimeError("Could not read data, please check file type")
Expand Down
Loading