提交 b8240fb8 编写于 作者: S Steffy-zxf 提交者: wuzewu

Update uncompressed model name (#8)

* Update uncompressed model name
上级 a6fb82c2
...@@ -60,9 +60,11 @@ class DownloadCommand(BaseCommand): ...@@ -60,9 +60,11 @@ class DownloadCommand(BaseCommand):
else: else:
search_result = default_hub_server.get_resource_url( search_result = default_hub_server.get_resource_url(
mod_name, resource_type="Module", version=mod_version) mod_name, resource_type="Module", version=mod_version)
self.args.type = "Module"
if search_result == {}: if search_result == {}:
search_result = default_hub_server.get_resource_url( search_result = default_hub_server.get_resource_url(
mod_name, resource_type="Model", version=mod_version) mod_name, resource_type="Model", version=mod_version)
self.args.type = "Model"
url = search_result.get('url', None) url = search_result.get('url', None)
except_md5_value = search_result.get('md5', None) except_md5_value = search_result.get('md5', None)
if not url: if not url:
...@@ -97,9 +99,11 @@ class DownloadCommand(BaseCommand): ...@@ -97,9 +99,11 @@ class DownloadCommand(BaseCommand):
result, tips, file = default_downloader.uncompress( result, tips, file = default_downloader.uncompress(
file=file, file=file,
dirname=self.args.output_path, dirname=self.args.output_path,
delete_file=False, delete_file=True,
print_progress=True) print_progress=True)
print(tips) print(tips)
if self.args.type == "Model":
os.rename(file, "./" + mod_name)
return True return True
def check_type(self, mod_type): def check_type(self, mod_type):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册