Skip to content

Commit

Permalink
fix features property
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-hh committed Oct 10, 2024
1 parent ee45f7f commit b828575
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/datasets/iterable_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1728,7 +1728,7 @@ def __init__(
):
super().__init__()
self.ex_iterable = ex_iterable
self.features = features
self._features = features
self.formatting = formatting
self.token_per_repo_id = token_per_repo_id

Expand All @@ -1739,7 +1739,11 @@ def iter_arrow(self):

@property
def is_typed(self):
return self.features is not None
return self._features is not None

@property
def features(self):
return self._features

def _init_state_dict(self) -> dict:
self._state_dict = self.ex_iterable._init_state_dict()
Expand All @@ -1750,7 +1754,7 @@ def __iter__(self):
formatter = PythonFormatter()
else:
formatter = get_formatter(
self.formatting.format_type, features=self.features, token_per_repo_id=self.token_per_repo_id
self.formatting.format_type, features=self._features, token_per_repo_id=self.token_per_repo_id
)
if self.ex_iterable.iter_arrow:
# feature casting (inc column addition) handled within self._iter_arrow()
Expand Down

0 comments on commit b828575

Please sign in to comment.