From e0d4a24b5c0cf4bdcd6fcecbd9f1ccb2505540e3 Mon Sep 17 00:00:00 2001 From: xulongteng Date: Fri, 25 Oct 2019 10:18:30 +0800 Subject: [PATCH] fix bert client bug --- demo-client/src/bert_service.cpp | 1 + demo-serving/op/bert_service_op.cpp | 4 ++-- sdk-cpp/proto/bert_service.proto | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/demo-client/src/bert_service.cpp b/demo-client/src/bert_service.cpp index 11a5276f..f2720786 100644 --- a/demo-client/src/bert_service.cpp +++ b/demo-client/src/bert_service.cpp @@ -94,6 +94,7 @@ int create_req(Request* req, } } ins->set_max_seq_len(max_seq_len); + ins->set_emb_size(emb_size); } return 0; } diff --git a/demo-serving/op/bert_service_op.cpp b/demo-serving/op/bert_service_op.cpp index f4713782..f34d113a 100644 --- a/demo-serving/op/bert_service_op.cpp +++ b/demo-serving/op/bert_service_op.cpp @@ -127,13 +127,13 @@ int BertServiceOp::inference() { #if 0 // print request std::ostringstream oss; for (int j = 0; j < 3; j++) { - int64_t* example = reinterpret_cast(*in)[j].data.data(); + int64_t* example = reinterpret_cast((*in)[j].data.data()); for (uint32_t i = 0; i < MAX_SEQ_LEN; i++) { oss << *(example + i) << " "; } oss << ";"; } - float* example = reinterpret_cast(*in)[3].data.data(); + float* example = reinterpret_cast((*in)[3].data.data()); for (int i = 0; i < MAX_SEQ_LEN; i++) { oss << *(example + i) << " "; } diff --git a/sdk-cpp/proto/bert_service.proto b/sdk-cpp/proto/bert_service.proto index fbf07e70..01168560 100644 --- a/sdk-cpp/proto/bert_service.proto +++ b/sdk-cpp/proto/bert_service.proto @@ -38,7 +38,7 @@ message BertResInstance { repeated Embedding_values instances = 1; }; message Response { repeated BertResInstance instances = 1; optional int64 op_time = 2; - optional int64 infert_time = 3; + optional int64 infer_time = 3; }; service BertService { -- GitLab