mirror of
https://gitee.com/fastnlp/fastNLP.git
synced 2024-12-04 13:17:51 +08:00
给 _get_dataset_url 增加了使用自定义数据集下载路径的能力
This commit is contained in:
parent
bffde7857a
commit
84776696cd
@ -312,7 +312,8 @@ def _read_extend_url_file(filename, name)->str:
|
||||
return parts[1]
|
||||
return None
|
||||
|
||||
def _get_dataset_url(name):
|
||||
|
||||
def _get_dataset_url(name, dataset_dir: dict = None):
|
||||
r"""
|
||||
给定dataset的名称,返回下载url
|
||||
|
||||
@ -323,8 +324,9 @@ def _get_dataset_url(name):
|
||||
url = _read_extend_url_file(FASTNLP_EXTEND_DATASET_URL, name)
|
||||
if url:
|
||||
return url
|
||||
|
||||
filename = DATASET_DIR.get(name, None)
|
||||
|
||||
dataset_dir = DATASET_DIR if dataset_dir is None else dataset_dir
|
||||
filename = dataset_dir.get(name, None)
|
||||
if filename:
|
||||
url = _get_base_url('dataset') + filename
|
||||
return url
|
||||
|
Loading…
Reference in New Issue
Block a user