Skip to content

Commit

Permalink
fix: Avoid reading all mmaped sparse vectors into memory (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
KShivendu authored Apr 17, 2024
1 parent a8bcf78 commit 73bb7d1
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions dataset_reader/sparse_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ def read_csr_matrix(filename: Union[Path, str], do_mmap=True) -> Iterator[Sparse
values, columns, index_pointer = mmap_sparse_matrix_fields(filename)
else:
values, columns, index_pointer = read_sparse_matrix_fields(filename)
values = values.tolist()
columns = columns.tolist()
index_pointer = index_pointer.tolist()

yield from csr_to_sparse_vectors(values, columns, index_pointer)

Expand Down

0 comments on commit 73bb7d1

Please sign in to comment.