Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
923b2b0d
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 1 年 前同步成功
通知
186
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看板
提交
923b2b0d
编写于
2月 23, 2020
作者:
M
MRXLT
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add client lib
上级
a8cd270e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
5 deletion
+24
-5
python/paddle_serving_client/__init__.py
python/paddle_serving_client/__init__.py
+11
-1
python/paddle_serving_client/version.py
python/paddle_serving_client/version.py
+1
-1
python/setup.py.client.in
python/setup.py.client.in
+12
-3
未找到文件。
python/paddle_serving_client/__init__.py
浏览文件 @
923b2b0d
...
...
@@ -12,7 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
.serving_client
import
PredictorClient
import
paddle_serving_client
import
os
from
.proto
import
sdk_configure_pb2
as
sdk
from
.proto
import
general_model_config_pb2
as
m_config
import
google.protobuf.text_format
...
...
@@ -75,8 +76,17 @@ class Client(object):
self
.
feed_shapes_
=
[]
self
.
feed_types_
=
{}
self
.
feed_names_to_idx_
=
{}
self
.
rpath
()
def
rpath
(
self
):
lib_path
=
os
.
path
.
dirname
(
paddle_serving_client
.
__file__
)
client_path
=
os
.
path
.
join
(
lib_path
,
'serving_client.so'
)
lib_path
=
os
.
path
.
join
(
lib_path
,
'lib'
)
os
.
popen
(
'patchelf --set-rpath {} {}'
.
format
(
lib_path
,
client_path
))
def
load_client_config
(
self
,
path
):
from
.serving_client
import
PredictorClient
model_conf
=
m_config
.
GeneralModelConfig
()
f
=
open
(
path
,
'r'
)
model_conf
=
google
.
protobuf
.
text_format
.
Merge
(
...
...
python/paddle_serving_client/version.py
浏览文件 @
923b2b0d
...
...
@@ -12,6 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
""" Paddle Serving Client version string """
serving_client_version
=
"0.1.
0
"
serving_client_version
=
"0.1.
1
"
serving_server_version
=
"0.1.0"
module_proto_version
=
"0.1.0"
python/setup.py.client.in
浏览文件 @
923b2b0d
...
...
@@ -17,6 +17,7 @@ from __future__ import division
from __future__ import print_function
import platform
import os
from setuptools import setup, Distribution, Extension
from setuptools import find_packages
...
...
@@ -26,7 +27,15 @@ from paddle_serving_client.version import serving_client_version
def python_version():
return [int(v) for v in platform.python_version().split(".")]
def copy_lib():
os.popen('mkdir -p paddle_serving_client/lib')
for lib in ['libpython2.7.so.1.0', 'libssl.so.10', 'libcrypto.so.10']:
r = os.popen('whereis {}'.format(lib))
text = r.read()
os.popen('cp {} ./paddle_serving_client/lib'.format(text.strip().split(' ')[1]))
max_version, mid_version, min_version = python_version()
copy_lib()
REQUIRED_PACKAGES = [
'six >= 1.10.0', 'protobuf >= 3.1.0','paddlepaddle'
...
...
@@ -36,8 +45,8 @@ packages=['paddle_serving_client',
'paddle_serving_client.proto',
'paddle_serving_client.io',
'paddle_serving_client.metric',
'paddle_serving_client.utils']
package_data={'paddle_serving_client': ['serving_client.so'
]
}
'paddle_serving_client.utils'
,
]
package_data={'paddle_serving_client': ['serving_client.so'
,'lib/*'],
}
package_dir={'paddle_serving_client':
'${PADDLE_SERVING_BINARY_DIR}/python/paddle_serving_client',
'paddle_serving_client.proto':
...
...
@@ -47,7 +56,7 @@ package_dir={'paddle_serving_client':
'paddle_serving_client.metric':
'${PADDLE_SERVING_BINARY_DIR}/python/paddle_serving_client/metric',
'paddle_serving_client.utils':
'${PADDLE_SERVING_BINARY_DIR}/python/paddle_serving_client/utils'}
'${PADDLE_SERVING_BINARY_DIR}/python/paddle_serving_client/utils'
,
}
setup(
name='paddle-serving-client',
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录