Unverified Commit 0c970caa authored by Aaron Mangum's avatar Aaron Mangum Committed by GitHub
Browse files

catch exception if pathlib not install

parent 2152bfea
...@@ -29,7 +29,7 @@ try: ...@@ -29,7 +29,7 @@ try:
from pathlib import Path from pathlib import Path
PYTORCH_PRETRAINED_BERT_CACHE = Path(os.getenv('PYTORCH_PRETRAINED_BERT_CACHE', PYTORCH_PRETRAINED_BERT_CACHE = Path(os.getenv('PYTORCH_PRETRAINED_BERT_CACHE',
Path.home() / '.pytorch_pretrained_bert')) Path.home() / '.pytorch_pretrained_bert'))
except AttributeError: except (AttributeError, ImportError):
PYTORCH_PRETRAINED_BERT_CACHE = os.getenv('PYTORCH_PRETRAINED_BERT_CACHE', PYTORCH_PRETRAINED_BERT_CACHE = os.getenv('PYTORCH_PRETRAINED_BERT_CACHE',
os.path.join(os.path.expanduser("~"), '.pytorch_pretrained_bert')) os.path.join(os.path.expanduser("~"), '.pytorch_pretrained_bert'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment