diff --git a/demo-serving/op/bert_service_op.h b/demo-serving/op/bert_service_op.h index 82c366237c2c263a85c2f7728301d8ec317594d3..ddc38b5612dfa570bc2d2669b8c35099b75515c2 100644 --- a/demo-serving/op/bert_service_op.h +++ b/demo-serving/op/bert_service_op.h @@ -25,6 +25,8 @@ #endif #include "demo-serving/bert_service.pb.h" +#include + namespace baidu { namespace paddle_serving { namespace serving { diff --git a/demo-serving/proto/bert_service.proto b/demo-serving/proto/bert_service.proto index 3eba501317c2533ad8c02d79d5eca2dc6682a65e..4ba3c536d5e31492742a7ae43ee1e3bb13a3db14 100644 --- a/demo-serving/proto/bert_service.proto +++ b/demo-serving/proto/bert_service.proto @@ -25,8 +25,8 @@ message BertReqInstance { repeated int64 sentence_type_ids = 2; repeated int64 position_ids = 3; repeated float input_masks = 4; - required int64 max_seq_len = 5; - required int64 emb_size = 6; + optional int64 max_seq_len = 5; + optional int64 emb_size = 6; }; message Request { repeated BertReqInstance instances = 1; }; diff --git a/sdk-cpp/proto/bert_service.proto b/sdk-cpp/proto/bert_service.proto index 6d130fa3245d4111442fe12792203527af4813d1..fbf07e705985a336333984622a00007667d67dd3 100644 --- a/sdk-cpp/proto/bert_service.proto +++ b/sdk-cpp/proto/bert_service.proto @@ -25,7 +25,8 @@ message BertReqInstance { repeated int64 sentence_type_ids = 2; repeated int64 position_ids = 3; 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; }; @@ -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 infert_time = 3; +}; service BertService { rpc inference(Request) returns (Response);