Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
4b6ba462
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看板
提交
4b6ba462
编写于
10月 24, 2019
作者:
X
xulongteng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'bert' of
https://github.com/MRXLT/Serving
into bert
上级
afcd0199
e0b6ddc0
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
58 addition
and
7 deletion
+58
-7
demo-serving/conf/cube.conf
demo-serving/conf/cube.conf
+1
-1
demo-serving/conf/model_toolkit.prototxt
demo-serving/conf/model_toolkit.prototxt
+39
-1
demo-serving/op/bert_service_op.cpp
demo-serving/op/bert_service_op.cpp
+2
-1
demo-serving/op/bert_service_op.h
demo-serving/op/bert_service_op.h
+2
-0
demo-serving/proto/bert_service.proto
demo-serving/proto/bert_service.proto
+7
-2
sdk-cpp/proto/bert_service.proto
sdk-cpp/proto/bert_service.proto
+7
-2
未找到文件。
demo-serving/conf/cube.conf
浏览文件 @
4b6ba462
[{
[{
"dict_name"
:
"dict"
,
"dict_name"
:
"
test_
dict"
,
"shard"
:
2
,
"shard"
:
2
,
"dup"
:
1
,
"dup"
:
1
,
"timeout"
:
200
,
"timeout"
:
200
,
...
...
demo-serving/conf/model_toolkit.prototxt
浏览文件 @
4b6ba462
engines {
name: "image_classification_resnet"
type: "FLUID_CPU_ANALYSIS_DIR"
reloadable_meta: "./data/model/paddle/fluid_time_file"
reloadable_type: "timestamp_ne"
model_data_path: "./data/model/paddle/fluid/SE_ResNeXt50_32x4d"
runtime_thread_num: 0
batch_infer_size: 0
enable_batch_align: 0
enable_memory_optimization: true
static_optimization: false
force_update_static_cache: false
}
engines {
name: "text_classification_bow"
type: "FLUID_CPU_ANALYSIS_DIR"
reloadable_meta: "./data/model/paddle/fluid_time_file"
reloadable_type: "timestamp_ne"
model_data_path: "./data/model/paddle/fluid/text_classification_lstm"
runtime_thread_num: 0
batch_infer_size: 0
enable_batch_align: 0
}
engines {
name: "ctr_prediction"
type: "FLUID_CPU_ANALYSIS_DIR"
reloadable_meta: "./data/model/paddle/fluid_time_file"
reloadable_type: "timestamp_ne"
model_data_path: "./data/model/paddle/fluid/ctr_prediction"
runtime_thread_num: 0
batch_infer_size: 0
enable_batch_align: 0
sparse_param_service_type: REMOTE
sparse_param_service_table_name: "test_dict"
}
engines {
engines {
name: "bert"
name: "bert"
type: "FLUID_
G
PU_ANALYSIS_DIR"
type: "FLUID_
C
PU_ANALYSIS_DIR"
reloadable_meta: "./data/model/paddle/fluid_time_file"
reloadable_meta: "./data/model/paddle/fluid_time_file"
reloadable_type: "timestamp_ne"
reloadable_type: "timestamp_ne"
model_data_path: "./data/model/paddle/fluid/bert"
model_data_path: "./data/model/paddle/fluid/bert"
...
...
demo-serving/op/bert_service_op.cpp
浏览文件 @
4b6ba462
...
@@ -31,7 +31,7 @@ using baidu::paddle_serving::predictor::bert_service::Embedding_values;
...
@@ -31,7 +31,7 @@ using baidu::paddle_serving::predictor::bert_service::Embedding_values;
extern
int64_t
MAX_SEQ_LEN
=
128
;
extern
int64_t
MAX_SEQ_LEN
=
128
;
const
bool
POOLING
=
true
;
const
bool
POOLING
=
true
;
const
int
LAYER_NUM
=
12
;
const
int
LAYER_NUM
=
12
;
const
int
EMB_SIZE
=
768
;
extern
int
EMB_SIZE
=
768
;
int
BertServiceOp
::
inference
()
{
int
BertServiceOp
::
inference
()
{
timeval
op_start
;
timeval
op_start
;
...
@@ -49,6 +49,7 @@ int BertServiceOp::inference() {
...
@@ -49,6 +49,7 @@ int BertServiceOp::inference() {
}
}
MAX_SEQ_LEN
=
req
->
instances
(
0
).
max_seq_len
();
MAX_SEQ_LEN
=
req
->
instances
(
0
).
max_seq_len
();
EMB_SIZE
=
req
->
instances
(
0
).
emb_size
();
paddle
::
PaddleTensor
src_ids
;
paddle
::
PaddleTensor
src_ids
;
paddle
::
PaddleTensor
pos_ids
;
paddle
::
PaddleTensor
pos_ids
;
...
...
demo-serving/op/bert_service_op.h
浏览文件 @
4b6ba462
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
#endif
#endif
#include "demo-serving/bert_service.pb.h"
#include "demo-serving/bert_service.pb.h"
#include <sys/time.h>
namespace
baidu
{
namespace
baidu
{
namespace
paddle_serving
{
namespace
paddle_serving
{
namespace
serving
{
namespace
serving
{
...
...
demo-serving/proto/bert_service.proto
浏览文件 @
4b6ba462
...
@@ -25,7 +25,8 @@ message BertReqInstance {
...
@@ -25,7 +25,8 @@ message BertReqInstance {
repeated
int64
sentence_type_ids
=
2
;
repeated
int64
sentence_type_ids
=
2
;
repeated
int64
position_ids
=
3
;
repeated
int64
position_ids
=
3
;
repeated
float
input_masks
=
4
;
repeated
float
input_masks
=
4
;
required
int64
max_seq_len
=
5
;
optional
int64
max_seq_len
=
5
;
optional
int64
emb_size
=
6
;
};
};
message
Request
{
repeated
BertReqInstance
instances
=
1
;
};
message
Request
{
repeated
BertReqInstance
instances
=
1
;
};
...
@@ -34,7 +35,11 @@ message Embedding_values { repeated float values = 1; };
...
@@ -34,7 +35,11 @@ message Embedding_values { repeated float values = 1; };
message
BertResInstance
{
repeated
Embedding_values
instances
=
1
;
};
message
BertResInstance
{
repeated
Embedding_values
instances
=
1
;
};
message
Response
{
repeated
BertResInstance
instances
=
1
;
};
message
Response
{
repeated
BertResInstance
instances
=
1
;
optional
int64
op_time
=
2
;
optional
int64
infer_time
=
3
;
};
service
BertService
{
service
BertService
{
rpc
inference
(
Request
)
returns
(
Response
);
rpc
inference
(
Request
)
returns
(
Response
);
...
...
sdk-cpp/proto/bert_service.proto
浏览文件 @
4b6ba462
...
@@ -25,7 +25,8 @@ message BertReqInstance {
...
@@ -25,7 +25,8 @@ message BertReqInstance {
repeated
int64
sentence_type_ids
=
2
;
repeated
int64
sentence_type_ids
=
2
;
repeated
int64
position_ids
=
3
;
repeated
int64
position_ids
=
3
;
repeated
float
input_masks
=
4
;
repeated
float
input_masks
=
4
;
required
int64
max_seq_len
=
5
;
optional
int64
max_seq_len
=
5
;
optional
int64
emb_size
=
6
;
};
};
message
Request
{
repeated
BertReqInstance
instances
=
1
;
};
message
Request
{
repeated
BertReqInstance
instances
=
1
;
};
...
@@ -34,7 +35,11 @@ message Embedding_values { repeated float values = 1; };
...
@@ -34,7 +35,11 @@ message Embedding_values { repeated float values = 1; };
message
BertResInstance
{
repeated
Embedding_values
instances
=
1
;
};
message
BertResInstance
{
repeated
Embedding_values
instances
=
1
;
};
message
Response
{
repeated
BertResInstance
instances
=
1
;
};
message
Response
{
repeated
BertResInstance
instances
=
1
;
optional
int64
op_time
=
2
;
optional
int64
infert_time
=
3
;
};
service
BertService
{
service
BertService
{
rpc
inference
(
Request
)
returns
(
Response
);
rpc
inference
(
Request
)
returns
(
Response
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录