提交 a5e2e351 编写于 作者: X xulongteng

support more model

上级 2baa063d
......@@ -31,7 +31,7 @@ using baidu::paddle_serving::predictor::bert_service::Embedding_values;
extern int64_t MAX_SEQ_LEN = 128;
const bool POOLING = true;
const int LAYER_NUM = 12;
const int EMB_SIZE = 768;
extern int EMB_SIZE = 768;
int BertServiceOp::inference() {
timeval op_start;
......@@ -49,6 +49,7 @@ int BertServiceOp::inference() {
}
MAX_SEQ_LEN = req->instances(0).max_seq_len();
EMB_SIZE = req->instances(0).emb_size();
paddle::PaddleTensor src_ids;
paddle::PaddleTensor pos_ids;
......
......@@ -26,6 +26,7 @@ message BertReqInstance {
repeated int64 position_ids = 3;
repeated float input_masks = 4;
required int64 max_seq_len = 5;
required int64 emb_size = 6;
};
message Request { repeated BertReqInstance instances = 1; };
......@@ -34,7 +35,11 @@ message Embedding_values { repeated float values = 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 {
rpc inference(Request) returns (Response);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册