Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
ec3eb64f
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 2 年 前同步成功
通知
187
Star
833
Fork
253
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
105
列表
看板
标记
里程碑
合并请求
10
Wiki
2
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Serving
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
105
Issue
105
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
2
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ec3eb64f
编写于
6月 15, 2020
作者:
G
gongweibao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix ci test=develop
上级
5f89b3d1
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
16 addition
and
21 deletion
+16
-21
core/configure/proto/multi_lang_general_model_service.proto
core/configure/proto/multi_lang_general_model_service.proto
+4
-5
python/paddle_serving_client/__init__.py
python/paddle_serving_client/__init__.py
+5
-5
python/paddle_serving_server/__init__.py
python/paddle_serving_server/__init__.py
+3
-5
python/paddle_serving_server_gpu/__init__.py
python/paddle_serving_server_gpu/__init__.py
+3
-5
tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/setup.py
...cpp_examples/bert-gpu-serving/paddle-gpu-serving/setup.py
+1
-1
未找到文件。
core/configure/proto/multi_lang_general_model_service.proto
浏览文件 @
ec3eb64f
...
@@ -45,10 +45,9 @@ message ModelOutput {
...
@@ -45,10 +45,9 @@ message ModelOutput {
optional
string
engine_name
=
2
;
optional
string
engine_name
=
2
;
};
};
message
EmptyRequest
{
message
EmptyRequest
{};
};
message
ServingConfig
{
message
ServingConfig
{
required
int32
max_batch_size
=
1
;
required
int32
max_batch_size
=
1
;
required
string
proto_txt
=
2
;
required
string
proto_txt
=
2
;
};
};
...
...
python/paddle_serving_client/__init__.py
浏览文件 @
ec3eb64f
...
@@ -396,15 +396,14 @@ class MultiLangClient(object):
...
@@ -396,15 +396,14 @@ class MultiLangClient(object):
self
.
_parse_model_config
(
proto_txt
)
self
.
_parse_model_config
(
proto_txt
)
def
_load_client_config
(
self
):
def
_load_client_config
(
self
):
req
=
pb2
.
EmptyRequest
()
req
=
pb2
.
EmptyRequest
()
self
.
_config
=
self
.
stub_
.
get_config
(
req
)
self
.
_config
=
self
.
stub_
.
get_config
(
req
)
self
.
_parse_model_config
(
self
.
_config
.
proto_txt
)
self
.
_parse_model_config
(
self
.
_config
.
proto_txt
)
#print("config:", self._config)
#print("config:", self._config)
def
connect
(
self
,
endpoint
,
use_remote_config
=
True
):
def
connect
(
self
,
endpoint
,
use_remote_config
=
True
):
self
.
channel_
=
grpc
.
insecure_channel
(
endpoint
[
0
])
#TODO
self
.
channel_
=
grpc
.
insecure_channel
(
endpoint
[
0
])
#TODO
self
.
stub_
=
grpc_pb2
.
MultiLangGeneralModelServiceStub
(
self
.
stub_
=
grpc_pb2
.
MultiLangGeneralModelServiceStub
(
self
.
channel_
)
self
.
channel_
)
if
use_remote_config
:
if
use_remote_config
:
self
.
_load_client_config
()
self
.
_load_client_config
()
...
@@ -551,6 +550,7 @@ class MultiLangClient(object):
...
@@ -551,6 +550,7 @@ class MultiLangClient(object):
is_python
=
is_python
,
is_python
=
is_python
,
need_variant_tag
=
need_variant_tag
))
need_variant_tag
=
need_variant_tag
))
class
MultiLangPredictFuture
(
object
):
class
MultiLangPredictFuture
(
object
):
def
__init__
(
self
,
call_future
,
callback_func
):
def
__init__
(
self
,
call_future
,
callback_func
):
self
.
call_future_
=
call_future
self
.
call_future_
=
call_future
...
...
python/paddle_serving_server/__init__.py
浏览文件 @
ec3eb64f
...
@@ -440,8 +440,7 @@ class Server(object):
...
@@ -440,8 +440,7 @@ class Server(object):
os
.
system
(
command
)
os
.
system
(
command
)
class
MultiLangServerService
(
class
MultiLangServerService
(
grpc_pb2
.
MultiLangGeneralModelService
):
grpc_pb2
.
MultiLangGeneralModelService
):
def
__init__
(
self
,
model_config_path
,
endpoints
):
def
__init__
(
self
,
model_config_path
,
endpoints
):
from
paddle_serving_client
import
Client
from
paddle_serving_client
import
Client
...
@@ -547,7 +546,6 @@ class MultiLangServerService(
...
@@ -547,7 +546,6 @@ class MultiLangServerService(
return
self
.
_pack_resp_package
(
data
,
fetch_names
,
is_python
,
tag
)
return
self
.
_pack_resp_package
(
data
,
fetch_names
,
is_python
,
tag
)
class
MultiLangServer
(
object
):
class
MultiLangServer
(
object
):
def
__init__
(
self
,
worker_num
=
2
):
def
__init__
(
self
,
worker_num
=
2
):
self
.
bserver_
=
Server
()
self
.
bserver_
=
Server
()
...
...
python/paddle_serving_server_gpu/__init__.py
浏览文件 @
ec3eb64f
...
@@ -484,8 +484,7 @@ class Server(object):
...
@@ -484,8 +484,7 @@ class Server(object):
os
.
system
(
command
)
os
.
system
(
command
)
class
MultiLangServerService
(
class
MultiLangServerService
(
grpc_pb2
.
MultiLangGeneralModelService
):
grpc_pb2
.
MultiLangGeneralModelService
):
def
__init__
(
self
,
model_config_path
,
endpoints
):
def
__init__
(
self
,
model_config_path
,
endpoints
):
from
paddle_serving_client
import
Client
from
paddle_serving_client
import
Client
...
@@ -501,7 +500,6 @@ class MultiLangServerService(
...
@@ -501,7 +500,6 @@ class MultiLangServerService(
self
.
_max_batch_size
=
-
1
# <=0:unknown
self
.
_max_batch_size
=
-
1
# <=0:unknown
self
.
_proto_txt
=
proto_txt
self
.
_proto_txt
=
proto_txt
def
_parse_model_config
(
self
,
proto_txt
):
def
_parse_model_config
(
self
,
proto_txt
):
model_conf
=
m_config
.
GeneralModelConfig
()
model_conf
=
m_config
.
GeneralModelConfig
()
model_conf
=
google
.
protobuf
.
text_format
.
Merge
(
proto_txt
,
model_conf
)
model_conf
=
google
.
protobuf
.
text_format
.
Merge
(
proto_txt
,
model_conf
)
...
@@ -597,7 +595,7 @@ class MultiLangServerService(
...
@@ -597,7 +595,7 @@ class MultiLangServerService(
max_batch_size
=
os
.
getenv
(
key
)
max_batch_size
=
os
.
getenv
(
key
)
if
max_batch_size
:
if
max_batch_size
:
try
:
try
:
max_batch_size
=
int
(
max_batch_size
)
max_batch_size
=
int
(
max_batch_size
)
self
.
_max_batch_size
=
max_batch_size
self
.
_max_batch_size
=
max_batch_size
except
Exception
as
e
:
except
Exception
as
e
:
print
(
"invalid value:{} of {}"
.
format
(
max_batch_size
,
key
))
print
(
"invalid value:{} of {}"
.
format
(
max_batch_size
,
key
))
...
...
tools/cpp_examples/bert-gpu-serving/paddle-gpu-serving/setup.py
浏览文件 @
ec3eb64f
...
@@ -23,7 +23,7 @@ info_content = open(info_py, 'r').readlines()
...
@@ -23,7 +23,7 @@ info_content = open(info_py, 'r').readlines()
version_line
=
[
version_line
=
[
l
.
strip
()
for
l
in
info_content
if
l
.
startswith
(
'__version__'
)
l
.
strip
()
for
l
in
info_content
if
l
.
startswith
(
'__version__'
)
][
0
]
][
0
]
exec
(
version_line
)
# produce __version__
exec
(
version_line
)
# produce __version__
setuptools
.
setup
(
setuptools
.
setup
(
name
=
"paddle-gpu-serving"
,
name
=
"paddle-gpu-serving"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录