Skip to content

Commit

Permalink
fix dd
Browse files Browse the repository at this point in the history
  • Loading branch information
DesmonDay committed Oct 17, 2023
1 parent e1e0fc1 commit cba5f76
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions paddlenlp/data/causal_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,7 @@ def __init__(
self.return_doc_ids = return_doc_ids

# Build index mappings.
if need_data:
# Checks
if len(documents) == 0:
return
if need_data and len(documents) > 0:
assert np.min(documents) >= 0
assert np.max(documents) < indexed_dataset.sizes.shape[0]

Expand Down Expand Up @@ -328,7 +325,7 @@ def __init__(
paddle.distributed.barrier()

# Load mappings.
if need_data:
if need_data and len(documents) > 0:
start_time = time.time()
print_rank_0(f" > loading doc-idx mapping from {doc_idx_filename}")
self.doc_idx = np.load(doc_idx_filename, allow_pickle=True, mmap_mode="r")
Expand Down

0 comments on commit cba5f76

Please sign in to comment.