From c5935d8bc202cd9f3665f6bf67adfca09ac32684 Mon Sep 17 00:00:00 2001 From: Jack Zhou Date: Wed, 23 Dec 2020 16:42:48 +0800 Subject: [PATCH] fix windows url bug (#5137) fix windows url bug --- PaddleNLP/paddlenlp/embeddings/constant.py | 2 +- PaddleNLP/paddlenlp/embeddings/token_embedding.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PaddleNLP/paddlenlp/embeddings/constant.py b/PaddleNLP/paddlenlp/embeddings/constant.py index 1ab5ccd2..44a76afc 100644 --- a/PaddleNLP/paddlenlp/embeddings/constant.py +++ b/PaddleNLP/paddlenlp/embeddings/constant.py @@ -16,7 +16,7 @@ from enum import Enum import os.path as osp URL_ROOT = "https://paddlenlp.bj.bcebos.com" -EMBEDDING_URL_ROOT = osp.join(URL_ROOT, "models/embeddings") +EMBEDDING_URL_ROOT = URL_ROOT + "/models/embeddings" PAD_TOKEN = '[PAD]' UNK_TOKEN = '[UNK]' diff --git a/PaddleNLP/paddlenlp/embeddings/token_embedding.py b/PaddleNLP/paddlenlp/embeddings/token_embedding.py index c76fb9fb..2c17055c 100644 --- a/PaddleNLP/paddlenlp/embeddings/token_embedding.py +++ b/PaddleNLP/paddlenlp/embeddings/token_embedding.py @@ -69,7 +69,7 @@ class TokenEmbedding(nn.Embedding): vector_path = osp.join(EMBEDDING_HOME, embedding_name + ".npz") if not osp.exists(vector_path): # download - url = osp.join(EMBEDDING_URL_ROOT, embedding_name + ".tar.gz") + url = EMBEDDING_URL_ROOT + "/" + embedding_name + ".tar.gz" get_path_from_url(url, EMBEDDING_HOME) logger.info("Loading token embedding...") -- GitLab