catch exception if pathlib not install
This commit is contained in:
@@ -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'))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user