提交 3527f627 编写于 作者: M MRXLT 提交者: GitHub

Merge pull request #191 from guru4elephant/fix_go_request

Fix go request
......@@ -28,7 +28,7 @@ func main() {
var config_file_path string
config_file_path = os.Args[1]
handle := serving_client.LoadModelConfig(config_file_path)
handle = serving_client.Connect("127.0.0.1", "9292", handle)
handle = serving_client.Connect("127.0.0.1", "9393", handle)
test_file_path := os.Args[2]
fi, err := os.Open(test_file_path)
......
......@@ -43,11 +43,12 @@ type FetchInst struct {
type Request struct {
Insts []FeedInst `json:"insts"`
FetchVarNames []string `json:"fetch_var_names"`
ProfileServer bool `json:"profile_server"`
}
type Response struct {
Insts []FetchInst `json:"insts"`
MeanInferUs float32 `json:"mean_infer_us"`
ProfileTime []int64 `json:"profile_time"`
}
type Handle struct {
......@@ -125,9 +126,13 @@ func Predict(handle Handle, int_feed_map map[string][]int64, fetch []string) map
inst.TensorArray = tensor_array
var profiletime bool
profiletime = false
req := &Request{
Insts: []FeedInst{inst},
FetchVarNames: fetch}
FetchVarNames: fetch,
ProfileTime: profiletime}
b, err := json.Marshal(req)
......
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册