Skip to content

Commit

Permalink
Shuffle CC result on group before writing out (NVIDIA#110)
Browse files Browse the repository at this point in the history
Signed-off-by: Ayush Dattagupta <ayushdg95@gmail.com>
  • Loading branch information
ayushdg authored Jun 13, 2024
1 parent 38b0ac1 commit 4264bac
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nemo_curator/modules/fuzzy_dedup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,8 @@ def _run_connected_components(

assert num_nodes == len(labels_df)
print(f"assert num_nodes:{num_nodes}==labels_df:{len(labels_df)} passed")
# Ensure all docs in the same group are in the same partition
labels_df = labels_df.shuffle(on=["group"], ignore_index=True)
labels_df.to_parquet(output_path, write_index=False)
Comms.destroy()

Expand Down

0 comments on commit 4264bac

Please sign in to comment.