fix python 2.7 imports

This commit is contained in:
thomwolf
2019-02-11 10:35:36 +01:00
parent 8197eb9f10
commit 2071a9b86e
3 changed files with 15 additions and 2 deletions

View File

@@ -29,7 +29,7 @@ try:
from pathlib import Path
PYTORCH_PRETRAINED_BERT_CACHE = Path(os.getenv('PYTORCH_PRETRAINED_BERT_CACHE',
Path.home() / '.pytorch_pretrained_bert'))
except ImportError:
except AttributeError:
PYTORCH_PRETRAINED_BERT_CACHE = os.getenv('PYTORCH_PRETRAINED_BERT_CACHE',
os.path.join(os.path.expanduser("~"), '.pytorch_pretrained_bert'))