Skip to content

Commit

Permalink
Add trust_remote_code argument to ReaderHfds
Browse files Browse the repository at this point in the history
  • Loading branch information
grodino authored and rwightman committed Nov 8, 2024
1 parent eb94efb commit 7f0c1b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions timm/data/readers/reader_hfds.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def __init__(
input_key: str = 'image',
target_key: str = 'label',
download: bool = False,
trust_remote_code: bool = False
):
"""
"""
Expand All @@ -48,6 +49,7 @@ def __init__(
name, # 'name' maps to path arg in hf datasets
split=split,
cache_dir=self.root, # timm doesn't expect hidden cache dir for datasets, specify a path
trust_remote_code=trust_remote_code
)
# leave decode for caller, plus we want easy access to original path names...
self.dataset = self.dataset.cast_column(input_key, datasets.Image(decode=False))
Expand Down

0 comments on commit 7f0c1b1

Please sign in to comment.