Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleHub
提交
8ce73b13
P
PaddleHub
项目概览
PaddlePaddle
/
PaddleHub
大约 1 年 前同步成功
通知
282
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看板
提交
8ce73b13
编写于
1月 21, 2019
作者:
W
wuzewu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add paddle version to pb
上级
3b5c1a81
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
86 addition
and
12 deletion
+86
-12
paddle_hub/module.py
paddle_hub/module.py
+6
-1
paddle_hub/module_desc.proto
paddle_hub/module_desc.proto
+6
-1
paddle_hub/module_desc_pb2.py
paddle_hub/module_desc_pb2.py
+74
-10
未找到文件。
paddle_hub/module.py
浏览文件 @
8ce73b13
...
...
@@ -18,6 +18,7 @@ from __future__ import absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
paddle
import
paddle.fluid
as
fluid
import
numpy
as
np
import
tempfile
...
...
@@ -27,6 +28,7 @@ import pickle
from
collections
import
defaultdict
from
paddle_hub.downloader
import
download_and_uncompress
from
paddle_hub
import
module_desc_pb2
from
paddle_hub.logger
import
logger
from
paddle_hub.signature
import
Signature
from
paddle_hub.utils
import
to_list
from
paddle_hub.version
import
__version__
...
...
@@ -303,7 +305,10 @@ def create_module(sign_arr, module_dir=None, word_dict=None):
# create module pb
module_desc
=
module_desc_pb2
.
ModuleDesc
()
module_desc
.
version
=
__version__
module_desc
.
auth_info
.
hub_version
=
__version__
module_desc
.
auth_info
.
paddle_version
=
paddle
.
__version__
logger
.
info
(
"hub version is %s"
%
__version__
)
logger
.
info
(
"paddle version is %s"
%
paddle
.
__version__
)
program
=
program
.
clone
()
# save asset
...
...
paddle_hub/module_desc.proto
浏览文件 @
8ce73b13
...
...
@@ -36,6 +36,11 @@ message ModuleVar {
repeated
FeedDesc
feed_desc
=
2
;
}
message
AuthInfo
{
string
paddle_version
=
1
;
string
hub_version
=
2
;
}
// A Hub Module is stored in a directory with a file 'paddlehub.pb'
// containing a serialized protocol message of this type. The further contents
// of the directory depend on the storage format described by the message.
...
...
@@ -50,6 +55,6 @@ message ModuleDesc {
bool
contain_assets
=
4
;
string
version
=
5
;
AuthInfo
auth_info
=
5
;
};
paddle_hub/module_desc_pb2.py
浏览文件 @
8ce73b13
...
...
@@ -17,7 +17,7 @@ DESCRIPTOR = _descriptor.FileDescriptor(
package
=
'paddle_hub'
,
syntax
=
'proto3'
,
serialized_pb
=
_b
(
'
\n\x11
module_desc.proto
\x12\n
paddle_hub
\"
+
\n\x08\x46\x65\x65\x64\x44\x65
sc
\x12\x10\n\x08
var_name
\x18\x01
\x01
(
\t\x12\r\n\x05\x61
lias
\x18\x02
\x01
(
\t\"
,
\n\t
FetchDesc
\x12\x10\n\x08
var_name
\x18\x01
\x01
(
\t\x12\r\n\x05\x61
lias
\x18\x02
\x01
(
\t\"
_
\n\t
ModuleVar
\x12
)
\n\n
fetch_desc
\x18\x01
\x03
(
\x0b\x32\x15
.paddle_hub.FetchDesc
\x12\'\n\t
feed_desc
\x18\x02
\x03
(
\x0b\x32\x14
.paddle_hub.FeedDesc
\"
\xd9\x01\n\n
ModuleDesc
\x12\x0c\n\x04
name
\x18\x01
\x01
(
\t\x12\x36\n\x08
sign2var
\x18\x02
\x03
(
\x0b\x32
$.paddle_hub.ModuleDesc.Sign2varEntry
\x12\x14\n\x0c
return_numpy
\x18\x03
\x01
(
\x08\x12\x16\n\x0e\x63
ontain_assets
\x18\x04
\x01
(
\x08\x12\x0f\n\x07
version
\x18\x05
\x01
(
\t
\x1a\x46\n\r
Sign2varEntry
\x12\x0b\n\x03
key
\x18\x01
\x01
(
\t\x12
$
\n\x05
value
\x18\x02
\x01
(
\x0b\x32\x15
.paddle_hub.ModuleVar:
\x02\x38\x01\x42\x02
H
\x03\x62\x06
proto3'
'
\n\x11
module_desc.proto
\x12\n
paddle_hub
\"
+
\n\x08\x46\x65\x65\x64\x44\x65
sc
\x12\x10\n\x08
var_name
\x18\x01
\x01
(
\t\x12\r\n\x05\x61
lias
\x18\x02
\x01
(
\t\"
,
\n\t
FetchDesc
\x12\x10\n\x08
var_name
\x18\x01
\x01
(
\t\x12\r\n\x05\x61
lias
\x18\x02
\x01
(
\t\"
_
\n\t
ModuleVar
\x12
)
\n\n
fetch_desc
\x18\x01
\x03
(
\x0b\x32\x15
.paddle_hub.FetchDesc
\x12\'\n\t
feed_desc
\x18\x02
\x03
(
\x0b\x32\x14
.paddle_hub.FeedDesc
\"
7
\n\x08\x41
uthInfo
\x12\x16\n\x0e
paddle_version
\x18\x01
\x01
(
\t\x12\x13\n\x0b
hub_version
\x18\x02
\x01
(
\t\"\xf1\x01\n\n
ModuleDesc
\x12\x0c\n\x04
name
\x18\x01
\x01
(
\t\x12\x36\n\x08
sign2var
\x18\x02
\x03
(
\x0b\x32
$.paddle_hub.ModuleDesc.Sign2varEntry
\x12\x14\n\x0c
return_numpy
\x18\x03
\x01
(
\x08\x12\x16\n\x0e\x63
ontain_assets
\x18\x04
\x01
(
\x08\x12\'\n\t
auth_info
\x18\x05
\x01
(
\x0b\x32\x14
.paddle_hub.AuthInfo
\x1a\x46\n\r
Sign2varEntry
\x12\x0b\n\x03
key
\x18\x01
\x01
(
\t\x12
$
\n\x05
value
\x18\x02
\x01
(
\x0b\x32\x15
.paddle_hub.ModuleVar:
\x02\x38\x01\x42\x02
H
\x03\x62\x06
proto3'
))
_sym_db
.
RegisterFileDescriptor
(
DESCRIPTOR
)
...
...
@@ -177,6 +177,58 @@ _MODULEVAR = _descriptor.Descriptor(
serialized_end
=
219
,
)
_AUTHINFO
=
_descriptor
.
Descriptor
(
name
=
'AuthInfo'
,
full_name
=
'paddle_hub.AuthInfo'
,
filename
=
None
,
file
=
DESCRIPTOR
,
containing_type
=
None
,
fields
=
[
_descriptor
.
FieldDescriptor
(
name
=
'paddle_version'
,
full_name
=
'paddle_hub.AuthInfo.paddle_version'
,
index
=
0
,
number
=
1
,
type
=
9
,
cpp_type
=
9
,
label
=
1
,
has_default_value
=
False
,
default_value
=
_b
(
""
).
decode
(
'utf-8'
),
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
options
=
None
),
_descriptor
.
FieldDescriptor
(
name
=
'hub_version'
,
full_name
=
'paddle_hub.AuthInfo.hub_version'
,
index
=
1
,
number
=
2
,
type
=
9
,
cpp_type
=
9
,
label
=
1
,
has_default_value
=
False
,
default_value
=
_b
(
""
).
decode
(
'utf-8'
),
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
is_extension
=
False
,
extension_scope
=
None
,
options
=
None
),
],
extensions
=
[],
nested_types
=
[],
enum_types
=
[],
options
=
None
,
is_extendable
=
False
,
syntax
=
'proto3'
,
extension_ranges
=
[],
oneofs
=
[],
serialized_start
=
221
,
serialized_end
=
276
,
)
_MODULEDESC_SIGN2VARENTRY
=
_descriptor
.
Descriptor
(
name
=
'Sign2varEntry'
,
full_name
=
'paddle_hub.ModuleDesc.Sign2varEntry'
,
...
...
@@ -226,8 +278,8 @@ _MODULEDESC_SIGN2VARENTRY = _descriptor.Descriptor(
syntax
=
'proto3'
,
extension_ranges
=
[],
oneofs
=
[],
serialized_start
=
369
,
serialized_end
=
439
,
serialized_start
=
450
,
serialized_end
=
520
,
)
_MODULEDESC
=
_descriptor
.
Descriptor
(
...
...
@@ -302,15 +354,15 @@ _MODULEDESC = _descriptor.Descriptor(
extension_scope
=
None
,
options
=
None
),
_descriptor
.
FieldDescriptor
(
name
=
'
version
'
,
full_name
=
'paddle_hub.ModuleDesc.
version
'
,
name
=
'
auth_info
'
,
full_name
=
'paddle_hub.ModuleDesc.
auth_info
'
,
index
=
4
,
number
=
5
,
type
=
9
,
cpp_type
=
9
,
type
=
11
,
cpp_type
=
10
,
label
=
1
,
has_default_value
=
False
,
default_value
=
_b
(
""
).
decode
(
'utf-8'
)
,
default_value
=
None
,
message_type
=
None
,
enum_type
=
None
,
containing_type
=
None
,
...
...
@@ -328,8 +380,8 @@ _MODULEDESC = _descriptor.Descriptor(
syntax
=
'proto3'
,
extension_ranges
=
[],
oneofs
=
[],
serialized_start
=
2
22
,
serialized_end
=
439
,
serialized_start
=
2
79
,
serialized_end
=
520
,
)
_MODULEVAR
.
fields_by_name
[
'fetch_desc'
].
message_type
=
_FETCHDESC
...
...
@@ -337,9 +389,11 @@ _MODULEVAR.fields_by_name['feed_desc'].message_type = _FEEDDESC
_MODULEDESC_SIGN2VARENTRY
.
fields_by_name
[
'value'
].
message_type
=
_MODULEVAR
_MODULEDESC_SIGN2VARENTRY
.
containing_type
=
_MODULEDESC
_MODULEDESC
.
fields_by_name
[
'sign2var'
].
message_type
=
_MODULEDESC_SIGN2VARENTRY
_MODULEDESC
.
fields_by_name
[
'auth_info'
].
message_type
=
_AUTHINFO
DESCRIPTOR
.
message_types_by_name
[
'FeedDesc'
]
=
_FEEDDESC
DESCRIPTOR
.
message_types_by_name
[
'FetchDesc'
]
=
_FETCHDESC
DESCRIPTOR
.
message_types_by_name
[
'ModuleVar'
]
=
_MODULEVAR
DESCRIPTOR
.
message_types_by_name
[
'AuthInfo'
]
=
_AUTHINFO
DESCRIPTOR
.
message_types_by_name
[
'ModuleDesc'
]
=
_MODULEDESC
FeedDesc
=
_reflection
.
GeneratedProtocolMessageType
(
...
...
@@ -372,6 +426,16 @@ ModuleVar = _reflection.GeneratedProtocolMessageType(
))
_sym_db
.
RegisterMessage
(
ModuleVar
)
AuthInfo
=
_reflection
.
GeneratedProtocolMessageType
(
'AuthInfo'
,
(
_message
.
Message
,
),
dict
(
DESCRIPTOR
=
_AUTHINFO
,
__module__
=
'module_desc_pb2'
# @@protoc_insertion_point(class_scope:paddle_hub.AuthInfo)
))
_sym_db
.
RegisterMessage
(
AuthInfo
)
ModuleDesc
=
_reflection
.
GeneratedProtocolMessageType
(
'ModuleDesc'
,
(
_message
.
Message
,
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录