paddlespeech.cli.download module

paddlespeech.cli.download.get_path_from_url(url, root_dir, md5sum=None, check_exist=True, decompress=True, method='get')[source]

Download from given url to root_dir. if file or directory specified by url is exists under root_dir, return the path directly, otherwise download from url and decompress it, return the path. Args:

url (str): download url root_dir (str): root dir for downloading, it should be

WEIGHTS_HOME or DATASET_HOME

md5sum (str): md5 sum of download package decompress (bool): decompress zip or tar file. Default is True method (str): which download method to use. Support wget and get. Default is get.

Returns:

str: a local path to save downloaded models & weights & datasets.