From 6ed7e32f7cbef032ca8c5b805c5501227b4358ee Mon Sep 17 00:00:00 2001 From: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> Date: Thu, 3 Dec 2020 10:50:13 -0500 Subject: [PATCH] Fix move when the two cache folders exist (#8917) --- src/transformers/file_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/transformers/file_utils.py b/src/transformers/file_utils.py index ae05e11b38..bcb62f1083 100644 --- a/src/transformers/file_utils.py +++ b/src/transformers/file_utils.py @@ -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. if ( 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_TRANSFORMERS_CACHE" not in os.environ and "TRANSFORMERS_CACHE" not in os.environ