Skip to content

Commit

Permalink
add from_indexable clsmethod
Browse files Browse the repository at this point in the history
  • Loading branch information
avishaihalev committed Jun 15, 2024
1 parent 33a02b9 commit 575132f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mmap_ninja/src/mmap_ninja/ragged.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,14 @@ def from_generator(cls, out_dir: Union[str, Path], sample_generator, batch_size:
batch_ctor=cls.from_lists,
**kwargs,
)

@classmethod
def from_indexable(cls, out_dir: Union[str, Path], indexable, batch_size: int, verbose=False, **kwargs):
return base.from_indexable_base(
out_dir=out_dir,
indexable=indexable,
batch_size=batch_size,
verbose=verbose,
batch_ctor=cls.from_lists,
**kwargs,
)

0 comments on commit 575132f

Please sign in to comment.