Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
1adab94b
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看板
提交
1adab94b
编写于
3月 11, 2021
作者:
Z
zhangjun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update python code
上级
6829588e
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
59 addition
and
27 deletion
+59
-27
python/CMakeLists.txt
python/CMakeLists.txt
+3
-3
python/gen_version.py
python/gen_version.py
+1
-1
python/paddle_serving_server/__init__.py
python/paddle_serving_server/__init__.py
+15
-4
python/paddle_serving_server/serve.py
python/paddle_serving_server/serve.py
+1
-1
python/paddle_serving_server/server.py
python/paddle_serving_server/server.py
+15
-13
python/paddle_serving_server/version.py
python/paddle_serving_server/version.py
+19
-0
python/paddle_serving_server/web_service.py
python/paddle_serving_server/web_service.py
+5
-5
未找到文件。
python/CMakeLists.txt
浏览文件 @
1adab94b
...
...
@@ -63,11 +63,11 @@ endif()
if
(
SERVER
)
if
(
CUDA_VERSION EQUAL 10.1
)
set
(
SUFFIX 101
)
set
(
VERSION_
SUFFIX 101
)
elseif
(
CUDA_VERSION EQUAL 10.2
)
set
(
SUFFIX 102
)
set
(
VERSION_
SUFFIX 102
)
elseif
(
CUDA_VERSION EQUAL 11.0
)
set
(
SUFFIX 11
)
set
(
VERSION_
SUFFIX 11
)
endif
()
add_custom_command
(
...
...
python/gen_version.py
浏览文件 @
1adab94b
...
...
@@ -35,7 +35,7 @@ def update_info(file_name, feature, info):
if
len
(
sys
.
argv
)
>
2
:
update_info
(
"paddle_serving_server/version.py"
,
"
cuda_version
"
,
update_info
(
"paddle_serving_server/version.py"
,
"
version_suffix
"
,
sys
.
argv
[
2
])
path
=
"paddle_serving_"
+
sys
.
argv
[
1
]
...
...
python/paddle_serving_server/__init__.py
浏览文件 @
1adab94b
...
...
@@ -13,8 +13,19 @@
# limitations under the License.
# pylint: disable=doc-string-missing
SERVER_VERSION
=
"0.0.0"
from
.
import
dag
from
.
import
monitor
from
.
import
rpc_service
from
.
import
serve
from
.
import
web_service
from
.
import
version
from
dag
import
*
from
monitor
import
*
from
rpc_service
import
*
from
serve
import
*
from
web_service
import
*
from
version
import
*
__version__
=
SERVER_VERSION
cuda_version
=
"9"
commit_id
=
""
\ No newline at end of file
SERVER_VERSION
=
"0.0.0"
__version__
=
SERVER_VERSION
\ No newline at end of file
python/paddle_serving_server/serve.py
浏览文件 @
1adab94b
...
...
@@ -23,7 +23,7 @@ import json
import
base64
import
time
from
multiprocessing
import
Pool
,
Process
from
paddle_serving_server
_gpu
import
serve_args
from
paddle_serving_server
import
serve_args
from
flask
import
Flask
,
request
import
sys
if
sys
.
version_info
.
major
==
2
:
...
...
python/paddle_serving_server/server.py
浏览文件 @
1adab94b
...
...
@@ -2,7 +2,7 @@
import
os
import
tarfile
import
socket
import
paddle_serving_server
_gpu
as
paddle_serving_server
import
paddle_serving_server
as
paddle_serving_server
import
time
from
.version
import
serving_server_version
from
contextlib
import
closing
...
...
@@ -157,18 +157,19 @@ class Server(object):
if
device
==
"arm"
:
engine
.
use_lite
=
self
.
use_lite
engine
.
use_xpu
=
self
.
use_xpu
if
device
==
"cpu"
:
if
use_encryption_model
:
engine
.
type
=
"FLUID_CPU_ANALYSIS_ENCRPT"
else
:
engine
.
type
=
"FLUID_CPU_ANALYSIS"
+
suffix
elif
device
==
"gpu"
:
if
use_encryption_model
:
engine
.
type
=
"FLUID_GPU_ANALYSIS_ENCRPT"
else
:
engine
.
type
=
"FLUID_GPU_ANALYSIS"
+
suffix
elif
device
==
"arm"
:
engine
.
type
=
"FLUID_ARM_ANALYSIS"
+
suffix
engine
.
type
=
"PaddleInferenceEngine"
# if device == "cpu":
# if use_encryption_model:
# engine.type = "FLUID_CPU_ANALYSIS_ENCRPT"
# else:
# engine.type = "FLUID_CPU_ANALYSIS" + suffix
# elif device == "gpu":
# if use_encryption_model:
# engine.type = "FLUID_GPU_ANALYSIS_ENCRPT"
# else:
# engine.type = "FLUID_GPU_ANALYSIS" + suffix
# elif device == "arm":
# engine.type = "FLUID_ARM_ANALYSIS" + suffix
self
.
model_toolkit_conf
.
engines
.
extend
([
engine
])
def
_prepare_infer_service
(
self
,
port
):
...
...
@@ -290,6 +291,7 @@ class Server(object):
version_file
=
open
(
"{}/version.py"
.
format
(
self
.
module_path
),
"r"
)
import
re
for
line
in
version_file
.
readlines
():
# to add, version_suffix
if
re
.
match
(
"cuda_version"
,
line
):
cuda_version
=
line
.
split
(
"
\"
"
)[
1
]
if
cuda_version
==
"101"
or
cuda_version
==
"102"
:
...
...
python/paddle_serving_server/version.py
0 → 100644
浏览文件 @
1adab94b
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
""" Paddle Serving Client version string """
serving_client_version
=
"0.0.0"
serving_server_version
=
"0.0.0"
module_proto_version
=
"0.0.0"
cuda_version
=
"9"
commit_id
=
""
python/paddle_serving_server/web_service.py
浏览文件 @
1adab94b
...
...
@@ -18,15 +18,15 @@ from flask import Flask, request, abort
from
contextlib
import
closing
from
multiprocessing
import
Pool
,
Process
,
Queue
from
paddle_serving_client
import
Client
from
paddle_serving_server
_gpu
import
OpMaker
,
OpSeqMaker
,
Server
from
paddle_serving_server
_gpu
.serve
import
start_multi_card
from
paddle_serving_server
import
OpMaker
,
OpSeqMaker
,
Server
from
paddle_serving_server.serve
import
start_multi_card
import
socket
import
sys
import
numpy
as
np
import
paddle_serving_server
_gpu
as
serving
import
paddle_serving_server
as
serving
from
paddle_serving_server
_gpu
import
pipeline
from
paddle_serving_server
_gpu
.pipeline
import
Op
from
paddle_serving_server
import
pipeline
from
paddle_serving_server.pipeline
import
Op
def
port_is_available
(
port
):
with
closing
(
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
))
as
sock
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录