Fix move when the two cache folders exist (#8917)

This commit is contained in:
Sylvain Gugger
2020-12-03 10:50:13 -05:00
committed by GitHub
parent 8453201cfe
commit 6ed7e32f7c

View File

@@ -213,6 +213,7 @@ default_cache_path = os.path.join(hf_cache_home, "transformers")
# Onetime move from the old location to the new one if no ENV variable has been set. # Onetime move from the old location to the new one if no ENV variable has been set.
if ( if (
os.path.isdir(old_default_cache_path) os.path.isdir(old_default_cache_path)
and not os.path.isdir(default_cache_path)
and "PYTORCH_PRETRAINED_BERT_CACHE" not in os.environ and "PYTORCH_PRETRAINED_BERT_CACHE" not in os.environ
and "PYTORCH_TRANSFORMERS_CACHE" not in os.environ and "PYTORCH_TRANSFORMERS_CACHE" not in os.environ
and "TRANSFORMERS_CACHE" not in os.environ and "TRANSFORMERS_CACHE" not in os.environ