Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Adds a dataset that can be read and written lazily #5344

Merged
merged 21 commits into from
Aug 23, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Global imports
dirkgr committed Aug 20, 2021

Verified

This commit was signed with the committer’s verified signature.
MakisH Gerasimos Chourdakis
commit d58a52fd9c20bb56a0c21fc1448e46a964a2ebaa
3 changes: 1 addition & 2 deletions allennlp/common/sqlite_sparse_sequence.py
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
import shutil
from os import PathLike
from typing import MutableSequence, Any, Union, Iterable
from allennlp.tango.dataloader import ShuffledSequence

from sqlitedict import SqliteDict

@@ -26,8 +27,6 @@ def __getitem__(self, i: Union[int, slice]) -> Any:
else:
return None
elif isinstance(i, slice):
from allennlp.tango.dataloader import ShuffledSequence

return ShuffledSequence(self, range(*i.indices(len(self))))
else:
raise TypeError(f"list indices must be integers or slices, not {i.__class__.__name__}")