From bc659f86adfb26d7cf86e67fa4600b89e63ac07c Mon Sep 17 00:00:00 2001 From: hzhwcmhf Date: Tue, 11 Dec 2018 20:18:56 +0800 Subject: [PATCH] fix compatibility with python 3.5.2; convert path to str --- pytorch_pretrained_bert/file_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pytorch_pretrained_bert/file_utils.py b/pytorch_pretrained_bert/file_utils.py index f734b7e22b1..1b34407b82d 100644 --- a/pytorch_pretrained_bert/file_utils.py +++ b/pytorch_pretrained_bert/file_utils.py @@ -23,8 +23,8 @@ import requests logger = logging.getLogger(__name__) # pylint: disable=invalid-name -PYTORCH_PRETRAINED_BERT_CACHE = Path(os.getenv('PYTORCH_PRETRAINED_BERT_CACHE', - Path.home() / '.pytorch_pretrained_bert')) +PYTORCH_PRETRAINED_BERT_CACHE = str(Path(os.getenv('PYTORCH_PRETRAINED_BERT_CACHE', + Path.home() / '.pytorch_pretrained_bert'))) def url_to_filename(url: str, etag: str = None) -> str: