Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
ec3eb64f
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 1 年 前同步成功
通知
183
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
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,12 +45,11 @@ message ModelOutput {
optional
string
engine_name
=
2
;
};
message
EmptyRequest
{
};
message
EmptyRequest
{};
message
ServingConfig
{
required
int32
max_batch_size
=
1
;
required
string
proto_txt
=
2
;
message
ServingConfig
{
required
int32
max_batch_size
=
1
;
required
string
proto_txt
=
2
;
};
service
MultiLangGeneralModelService
{
...
...
python/paddle_serving_client/__init__.py
浏览文件 @
ec3eb64f
...
...
@@ -392,19 +392,18 @@ class MultiLangClient(object):
raise
Exception
(
"GClient only supports multi-model temporarily"
)
with
open
(
path
,
'r'
)
as
f
:
proto_txt
=
str
(
f
.
read
())
self
.
_parse_model_config
(
proto_txt
)
def
_load_client_config
(
self
):
req
=
pb2
.
EmptyRequest
()
self
.
_config
=
self
.
stub_
.
get_config
(
req
)
req
=
pb2
.
EmptyRequest
()
self
.
_config
=
self
.
stub_
.
get_config
(
req
)
self
.
_parse_model_config
(
self
.
_config
.
proto_txt
)
#print("config:", self._config)
def
connect
(
self
,
endpoint
,
use_remote_config
=
True
):
self
.
channel_
=
grpc
.
insecure_channel
(
endpoint
[
0
])
#TODO
self
.
stub_
=
grpc_pb2
.
MultiLangGeneralModelServiceStub
(
self
.
channel_
)
self
.
stub_
=
grpc_pb2
.
MultiLangGeneralModelServiceStub
(
self
.
channel_
)
if
use_remote_config
:
self
.
_load_client_config
()
...
...
@@ -551,6 +550,7 @@ class MultiLangClient(object):
is_python
=
is_python
,
need_variant_tag
=
need_variant_tag
))
class
MultiLangPredictFuture
(
object
):
def
__init__
(
self
,
call_future
,
callback_func
):
self
.
call_future_
=
call_future
...
...
python/paddle_serving_server/__init__.py
浏览文件 @
ec3eb64f
...
...
@@ -440,8 +440,7 @@ class Server(object):
os
.
system
(
command
)
class
MultiLangServerService
(
grpc_pb2
.
MultiLangGeneralModelService
):
class
MultiLangServerService
(
grpc_pb2
.
MultiLangGeneralModelService
):
def
__init__
(
self
,
model_config_path
,
endpoints
):
from
paddle_serving_client
import
Client
...
...
@@ -454,7 +453,7 @@ class MultiLangServerService(
self
.
bclient_
.
load_client_config
(
path
)
self
.
bclient_
.
connect
(
endpoints
)
self
.
_max_batch_size
=
-
1
# <=0:infinite
self
.
_max_batch_size
=
-
1
# <=0:infinite
self
.
_proto_txt
=
proto_txt
def
_parse_model_config
(
self
,
proto_txt
):
...
...
@@ -546,8 +545,7 @@ class MultiLangServerService(
feed
=
feed_dict
,
fetch
=
fetch_names
,
need_variant_tag
=
True
)
return
self
.
_pack_resp_package
(
data
,
fetch_names
,
is_python
,
tag
)
class
MultiLangServer
(
object
):
def
__init__
(
self
,
worker_num
=
2
):
self
.
bserver_
=
Server
()
...
...
python/paddle_serving_server_gpu/__init__.py
浏览文件 @
ec3eb64f
...
...
@@ -484,8 +484,7 @@ class Server(object):
os
.
system
(
command
)
class
MultiLangServerService
(
grpc_pb2
.
MultiLangGeneralModelService
):
class
MultiLangServerService
(
grpc_pb2
.
MultiLangGeneralModelService
):
def
__init__
(
self
,
model_config_path
,
endpoints
):
from
paddle_serving_client
import
Client
...
...
@@ -498,10 +497,9 @@ class MultiLangServerService(
self
.
bclient_
.
load_client_config
(
path
)
self
.
bclient_
.
connect
(
endpoints
)
self
.
_max_batch_size
=
-
1
# <=0:unknown
self
.
_max_batch_size
=
-
1
# <=0:unknown
self
.
_proto_txt
=
proto_txt
def
_parse_model_config
(
self
,
proto_txt
):
model_conf
=
m_config
.
GeneralModelConfig
()
model_conf
=
google
.
protobuf
.
text_format
.
Merge
(
proto_txt
,
model_conf
)
...
...
@@ -597,7 +595,7 @@ class MultiLangServerService(
max_batch_size
=
os
.
getenv
(
key
)
if
max_batch_size
:
try
:
max_batch_size
=
int
(
max_batch_size
)
max_batch_size
=
int
(
max_batch_size
)
self
.
_max_batch_size
=
max_batch_size
except
Exception
as
e
:
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()
version_line
=
[
l
.
strip
()
for
l
in
info_content
if
l
.
startswith
(
'__version__'
)
][
0
]
exec
(
version_line
)
# produce __version__
exec
(
version_line
)
# produce __version__
setuptools
.
setup
(
name
=
"paddle-gpu-serving"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录