Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleHub
提交
0ff7ae70
P
PaddleHub
项目概览
PaddlePaddle
/
PaddleHub
1 年多 前同步成功
通知
283
Star
12117
Fork
2091
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
200
列表
看板
标记
里程碑
合并请求
4
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleHub
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
200
Issue
200
列表
看板
标记
里程碑
合并请求
4
合并请求
4
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0ff7ae70
编写于
3月 15, 2019
作者:
W
wuzewu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix command-line bug
上级
28f7b25b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
13 addition
and
18 deletion
+13
-18
paddle_hub/commands/download.py
paddle_hub/commands/download.py
+2
-2
paddle_hub/commands/hub.py
paddle_hub/commands/hub.py
+3
-11
paddle_hub/commands/install.py
paddle_hub/commands/install.py
+1
-1
paddle_hub/commands/show.py
paddle_hub/commands/show.py
+6
-3
paddle_hub/commands/uninstall.py
paddle_hub/commands/uninstall.py
+1
-1
未找到文件。
paddle_hub/commands/download.py
浏览文件 @
0ff7ae70
...
...
@@ -38,12 +38,12 @@ class DownloadCommand(BaseCommand):
self
.
parser
.
print_help
()
def
exec
(
self
,
argv
):
module_name
=
argv
[
1
]
module_name
=
argv
[
0
]
module_version
=
None
if
"=="
not
in
module_name
else
module_name
.
split
(
"=="
)[
1
]
module_name
=
module_name
if
"=="
not
in
module_name
else
module_name
.
split
(
"=="
)[
0
]
self
.
args
=
self
.
parser
.
parse_args
(
argv
[
2
:])
self
.
args
=
self
.
parser
.
parse_args
(
argv
[
1
:])
if
not
self
.
args
.
output_path
:
self
.
args
.
output_path
=
"."
utils
.
check_path
(
self
.
args
.
output_path
)
...
...
paddle_hub/commands/hub.py
浏览文件 @
0ff7ae70
...
...
@@ -38,20 +38,12 @@ class HubCommand(BaseCommand):
def
exec
(
self
,
argv
):
args
=
self
.
parser
.
parse_args
(
argv
[
1
:
2
])
command_dict
=
{
'show'
:
show
.
command
.
exec
,
'run'
:
run
.
command
.
exec
,
'download'
:
download
.
command
.
exec
,
'help'
:
help
.
command
.
exec
,
'version'
:
version
.
command
.
exec
}
if
not
args
.
command
in
command_dict
:
if
not
args
.
command
in
BaseCommand
.
command_dict
:
logger
.
critical
(
"command %s not supported!"
%
args
.
command
)
exit
(
1
)
command
=
command_dict
[
args
.
command
]
command
(
argv
[
2
:])
command
=
BaseCommand
.
command_dict
[
args
.
command
]
command
.
exec
(
argv
[
2
:])
command
=
HubCommand
.
instance
()
...
...
paddle_hub/commands/install.py
浏览文件 @
0ff7ae70
...
...
@@ -34,7 +34,7 @@ class InstallCommand(BaseCommand):
self
.
parser
.
print_help
()
def
exec
(
self
,
argv
):
module_name
=
argv
[
1
]
module_name
=
argv
[
0
]
module_version
=
None
if
"=="
not
in
module_name
else
module_name
.
split
(
"=="
)[
1
]
module_name
=
module_name
if
"=="
not
in
module_name
else
module_name
.
split
(
...
...
paddle_hub/commands/show.py
浏览文件 @
0ff7ae70
...
...
@@ -19,6 +19,7 @@ from paddle_hub.tools.logger import logger
from
paddle_hub.commands.base_command
import
BaseCommand
from
paddle_hub.module.manager
import
default_manager
from
paddle_hub.module.module
import
Module
import
os
class
ShowCommand
(
BaseCommand
):
...
...
@@ -30,11 +31,13 @@ class ShowCommand(BaseCommand):
self
.
description
=
"Show the specify module's info"
def
exec
(
self
,
argv
):
module_name
=
argv
[
1
]
self
.
args
=
self
.
parser
.
parse_args
(
argv
[
2
:])
module_name
=
argv
[
0
]
cwd
=
os
.
getcwd
()
module_dir
=
default_manager
.
search_module
(
module_name
)
if
not
module_dir
:
module_dir
=
os
.
path
.
join
(
cwd
,
module_name
)
if
not
module_dir
else
module_dir
if
not
module_dir
or
not
os
.
path
.
exists
(
module_dir
):
return
module
=
Module
(
module_dir
=
module_dir
)
...
...
paddle_hub/commands/uninstall.py
浏览文件 @
0ff7ae70
...
...
@@ -30,7 +30,7 @@ class UninstallCommand(BaseCommand):
self
.
description
=
"Uninstall the specify module from current environment."
def
exec
(
self
,
argv
):
module_name
=
argv
[
1
]
module_name
=
argv
[
0
]
default_manager
.
uninstall_module
(
module_name
=
module_name
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录