Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
d011568d
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 1 年 前同步成功
通知
185
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,发现更多精彩内容 >>
提交
d011568d
编写于
6月 08, 2020
作者:
B
barrierye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update cmake
上级
4854efb2
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
100 addition
and
7 deletion
+100
-7
cmake/external/protobuf.cmake
cmake/external/protobuf.cmake
+64
-0
cmake/generic.cmake
cmake/generic.cmake
+9
-0
core/configure/CMakeLists.txt
core/configure/CMakeLists.txt
+20
-0
core/configure/proto/multi_lang_general_model_service.proto
core/configure/proto/multi_lang_general_model_service.proto
+0
-0
python/paddle_serving_client/__init__.py
python/paddle_serving_client/__init__.py
+2
-2
python/paddle_serving_server/__init__.py
python/paddle_serving_server/__init__.py
+2
-2
python/requirements.txt
python/requirements.txt
+1
-1
python/setup.py.client.in
python/setup.py.client.in
+1
-1
python/setup.py.server_gpu.in
python/setup.py.server_gpu.in
+1
-1
未找到文件。
cmake/external/protobuf.cmake
浏览文件 @
d011568d
...
...
@@ -86,6 +86,70 @@ function(protobuf_generate_python SRCS)
set
(
${
SRCS
}
${${
SRCS
}}
PARENT_SCOPE
)
endfunction
()
function
(
grpc_protobuf_generate_python SRCS
)
# shameless copy from https://github.com/Kitware/CMake/blob/master/Modules/FindProtobuf.cmake
if
(
NOT ARGN
)
message
(
SEND_ERROR
"Error: GRPC_PROTOBUF_GENERATE_PYTHON() called without any proto files"
)
return
()
endif
()
if
(
PROTOBUF_GENERATE_CPP_APPEND_PATH
)
# Create an include path for each file specified
foreach
(
FIL
${
ARGN
}
)
get_filename_component
(
ABS_FIL
${
FIL
}
ABSOLUTE
)
get_filename_component
(
ABS_PATH
${
ABS_FIL
}
PATH
)
list
(
FIND _protobuf_include_path
${
ABS_PATH
}
_contains_already
)
if
(
${
_contains_already
}
EQUAL -1
)
list
(
APPEND _protobuf_include_path -I
${
ABS_PATH
}
)
endif
()
endforeach
()
else
()
set
(
_protobuf_include_path -I
${
CMAKE_CURRENT_SOURCE_DIR
}
)
endif
()
if
(
DEFINED PROTOBUF_IMPORT_DIRS AND NOT DEFINED Protobuf_IMPORT_DIRS
)
set
(
Protobuf_IMPORT_DIRS
"
${
PROTOBUF_IMPORT_DIRS
}
"
)
endif
()
if
(
DEFINED Protobuf_IMPORT_DIRS
)
foreach
(
DIR
${
Protobuf_IMPORT_DIRS
}
)
get_filename_component
(
ABS_PATH
${
DIR
}
ABSOLUTE
)
list
(
FIND _protobuf_include_path
${
ABS_PATH
}
_contains_already
)
if
(
${
_contains_already
}
EQUAL -1
)
list
(
APPEND _protobuf_include_path -I
${
ABS_PATH
}
)
endif
()
endforeach
()
endif
()
set
(
${
SRCS
}
)
foreach
(
FIL
${
ARGN
}
)
get_filename_component
(
ABS_FIL
${
FIL
}
ABSOLUTE
)
get_filename_component
(
FIL_WE
${
FIL
}
NAME_WE
)
if
(
NOT PROTOBUF_GENERATE_CPP_APPEND_PATH
)
get_filename_component
(
FIL_DIR
${
FIL
}
DIRECTORY
)
if
(
FIL_DIR
)
set
(
FIL_WE
"
${
FIL_DIR
}
/
${
FIL_WE
}
"
)
endif
()
endif
()
list
(
APPEND
${
SRCS
}
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
FIL_WE
}
_pb2.py"
)
add_custom_command
(
OUTPUT
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
FIL_WE
}
_pb2.py"
COMMAND
${
PROTOBUF_PROTOC_EXECUTABLE
}
--python_out
${
CMAKE_CURRENT_BINARY_DIR
}
${
_protobuf_include_path
}
${
ABS_FIL
}
DEPENDS
${
ABS_FIL
}
${
PROTOBUF_PROTOC_EXECUTABLE
}
COMMENT
"Running Python protocol buffer compiler on
${
FIL
}
"
VERBATIM
)
list
(
APPEND
${
SRCS
}
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
FIL_WE
}
_pb2_grpc.py"
)
add_custom_command
(
OUTPUT
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
FIL_WE
}
_pb2_grpc.py"
COMMAND
${
PYTHON_EXECUTABLE
}
-m grpc_tools.protoc --python_out
${
CMAKE_CURRENT_BINARY_DIR
}
--grpc_python_out
${
CMAKE_CURRENT_BINARY_DIR
}
${
_protobuf_include_path
}
${
ABS_FIL
}
DEPENDS
${
ABS_FIL
}
COMMENT
"Running Python grpc protocol buffer compiler on
${
FIL
}
"
VERBATIM
)
endforeach
()
set
(
${
SRCS
}
${${
SRCS
}}
PARENT_SCOPE
)
endfunction
()
# Print and set the protobuf library information,
# finish this cmake process and exit from this file.
macro
(
PROMPT_PROTOBUF_LIB
)
...
...
cmake/generic.cmake
浏览文件 @
d011568d
...
...
@@ -704,6 +704,15 @@ function(py_proto_compile TARGET_NAME)
add_custom_target
(
${
TARGET_NAME
}
ALL DEPENDS
${
py_srcs
}
)
endfunction
()
function
(
py_grpc_proto_compile TARGET_NAME
)
set
(
oneValueArgs
""
)
set
(
multiValueArgs SRCS
)
cmake_parse_arguments
(
py_grpc_proto_compile
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
set
(
py_srcs
)
grpc_protobuf_generate_python
(
py_srcs
${
py_grpc_proto_compile_SRCS
}
)
add_custom_target
(
${
TARGET_NAME
}
ALL DEPENDS
${
py_srcs
}
)
endfunction
()
function
(
py_test TARGET_NAME
)
if
(
WITH_TESTING
)
set
(
options
""
)
...
...
core/configure/CMakeLists.txt
浏览文件 @
d011568d
...
...
@@ -35,6 +35,10 @@ py_proto_compile(general_model_config_py_proto SRCS proto/general_model_config.p
add_custom_target
(
general_model_config_py_proto_init ALL COMMAND
${
CMAKE_COMMAND
}
-E touch __init__.py
)
add_dependencies
(
general_model_config_py_proto general_model_config_py_proto_init
)
py_grpc_proto_compile
(
multi_lang_general_model_service_py_proto SRCS proto/multi_lang_general_model_service.proto
)
add_custom_target
(
multi_lang_general_model_service_py_proto_init ALL COMMAND
${
CMAKE_COMMAND
}
-E touch __init__.py
)
add_dependencies
(
multi_lang_general_model_service_py_proto multi_lang_general_model_service_py_proto_init
)
if
(
CLIENT
)
py_proto_compile
(
sdk_configure_py_proto SRCS proto/sdk_configure.proto
)
add_custom_target
(
sdk_configure_py_proto_init ALL COMMAND
${
CMAKE_COMMAND
}
-E touch __init__.py
)
...
...
@@ -51,6 +55,11 @@ add_custom_command(TARGET general_model_config_py_proto POST_BUILD
COMMENT
"Copy generated general_model_config proto file into directory paddle_serving_client/proto."
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
add_custom_command
(
TARGET multi_lang_general_model_service_py_proto POST_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
PADDLE_SERVING_BINARY_DIR
}
/python/paddle_serving_client/proto
COMMAND cp *.py
${
PADDLE_SERVING_BINARY_DIR
}
/python/paddle_serving_client/proto
COMMENT
"Copy generated multi_lang_general_model_service proto file into directory paddle_serving_client/proto."
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
endif
()
if
(
APP
)
...
...
@@ -77,6 +86,11 @@ add_custom_command(TARGET general_model_config_py_proto POST_BUILD
COMMAND cp *.py
${
PADDLE_SERVING_BINARY_DIR
}
/python/paddle_serving_server/proto
COMMENT
"Copy generated general_model_config proto file into directory paddle_serving_server/proto."
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
add_custom_command
(
TARGET multi_lang_general_model_service_py_proto POST_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
PADDLE_SERVING_BINARY_DIR
}
/python/paddle_serving_server/proto
COMMAND cp *.py
${
PADDLE_SERVING_BINARY_DIR
}
/python/paddle_serving_server/proto
COMMENT
"Copy generated multi_lang_general_model_service proto file into directory paddle_serving_server/proto."
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
else
()
add_custom_command
(
TARGET server_config_py_proto POST_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
...
...
@@ -95,5 +109,11 @@ add_custom_command(TARGET general_model_config_py_proto POST_BUILD
COMMENT
"Copy generated general_model_config proto file into directory
paddle_serving_server_gpu/proto."
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
add_custom_command
(
TARGET multi_lang_general_model_service_py_proto POST_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
PADDLE_SERVING_BINARY_DIR
}
/python/paddle_serving_server_gpu/proto
COMMAND cp *.py
${
PADDLE_SERVING_BINARY_DIR
}
/python/paddle_serving_server_gpu/proto
COMMENT
"Copy generated multi_lang_general_model_service proto file into directory paddle_serving_server_gpu/proto."
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
endif
()
endif
()
python/paddle_serving_server
/multi_lang_general_model_service.proto
→
core/configure/proto
/multi_lang_general_model_service.proto
浏览文件 @
d011568d
文件已移动
python/paddle_serving_client/__init__.py
浏览文件 @
d011568d
...
...
@@ -24,8 +24,8 @@ import sys
from
.serving_client
import
PredictorRes
import
grpc
import
multi_lang_general_model_service_pb2
import
multi_lang_general_model_service_pb2_grpc
from
.proto
import
multi_lang_general_model_service_pb2
from
.proto
import
multi_lang_general_model_service_pb2_grpc
int_type
=
0
float_type
=
1
...
...
python/paddle_serving_server/__init__.py
浏览文件 @
d011568d
...
...
@@ -27,8 +27,8 @@ import fcntl
import
numpy
as
np
import
grpc
import
multi_lang_general_model_service_pb2
import
multi_lang_general_model_service_pb2_grpc
from
.proto
import
multi_lang_general_model_service_pb2
from
.proto
import
multi_lang_general_model_service_pb2_grpc
from
multiprocessing
import
Pool
,
Process
from
concurrent
import
futures
...
...
python/requirements.txt
浏览文件 @
d011568d
numpy>=1.12, <=1.16.4 ; python_version<"3.5"
numpy>=1.12, <=1.16.4 ;
grpcio>=1.28.1 ;
python_version<"3.5"
python/setup.py.client.in
浏览文件 @
d011568d
...
...
@@ -58,7 +58,7 @@ if '${PACK}' == 'ON':
REQUIRED_PACKAGES = [
'six >= 1.10.0', 'protobuf >= 3.1.0', 'numpy >= 1.12'
'six >= 1.10.0', 'protobuf >= 3.1.0', 'numpy >= 1.12'
, 'grpcio >= 1.28.1'
]
if not find_package("paddlepaddle") and not find_package("paddlepaddle-gpu"):
...
...
python/setup.py.server_gpu.in
浏览文件 @
d011568d
...
...
@@ -37,7 +37,7 @@ def python_version():
max_version, mid_version, min_version = python_version()
REQUIRED_PACKAGES = [
'six >= 1.10.0', 'protobuf >= 3.1.0',
'six >= 1.10.0', 'protobuf >= 3.1.0',
'grpcio >= 1.28.1',
'paddle_serving_client', 'flask >= 1.1.1', 'paddle_serving_app'
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录