Skip to content

Commit 9e136ff

Browse files
committed
Honor args.overwrite_cache (h/t @erenup)
1 parent b350662 commit 9e136ff

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/run_glue.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def load_and_cache_examples(args, task, tokenizer, evaluate=False):
270270
list(filter(None, args.model_name_or_path.split('/'))).pop(),
271271
str(args.max_seq_length),
272272
str(task)))
273-
if os.path.exists(cached_features_file):
273+
if os.path.exists(cached_features_file) and not args.overwrite_cache:
274274
logger.info("Loading features from cached file %s", cached_features_file)
275275
features = torch.load(cached_features_file)
276276
else:

examples/run_multiple_choice.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def load_and_cache_examples(args, task, tokenizer, evaluate=False, test=False):
293293
list(filter(None, args.model_name_or_path.split('/'))).pop(),
294294
str(args.max_seq_length),
295295
str(task)))
296-
if os.path.exists(cached_features_file):
296+
if os.path.exists(cached_features_file) and not args.overwrite_cache:
297297
logger.info("Loading features from cached file %s", cached_features_file)
298298
features = torch.load(cached_features_file)
299299
else:

0 commit comments

Comments
 (0)