Skip to content

Commit 95d903f

Browse files
committed
Merge branch 'main' of github.com:grodino/pytorch-image-models into grodino-dataset_trust_remote
2 parents 9eee47d + 2dff16f commit 95d903f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

train.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@
103103
help='Dataset key for input images.')
104104
group.add_argument('--target-key', default=None, type=str,
105105
help='Dataset key for target labels.')
106+
group.add_argument('--dataset-trust-remote-code', action='store_true', default=False,
107+
help='Allow huggingface dataset import to execute code downloaded from the dataset\'s repo.')
106108

107109
# Model parameters
108110
group = parser.add_argument_group('Model parameters')
@@ -653,6 +655,7 @@ def main():
653655
input_key=args.input_key,
654656
target_key=args.target_key,
655657
num_samples=args.train_num_samples,
658+
trust_remote_code=args.dataset_trust_remote_code,
656659
)
657660

658661
if args.val_split:
@@ -668,6 +671,7 @@ def main():
668671
input_key=args.input_key,
669672
target_key=args.target_key,
670673
num_samples=args.val_num_samples,
674+
trust_remote_code=args.dataset_trust_remote_code,
671675
)
672676

673677
# setup mixup / cutmix

validate.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
help='Dataset image conversion mode for input images.')
6767
parser.add_argument('--target-key', default=None, type=str,
6868
help='Dataset key for target labels.')
69+
parser.add_argument('--dataset-trust-remote-code', action='store_true', default=False,
70+
help='Allow huggingface dataset import to execute code downloaded from the dataset\'s repo.')
6971

7072
parser.add_argument('--model', '-m', metavar='NAME', default='dpn92',
7173
help='model architecture (default: dpn92)')
@@ -268,6 +270,7 @@ def validate(args):
268270
input_key=args.input_key,
269271
input_img_mode=input_img_mode,
270272
target_key=args.target_key,
273+
trust_remote_code=args.dataset_trust_remote_code,
271274
)
272275

273276
if args.valid_labels:

0 commit comments

Comments
 (0)