| 53 | } |
| 54 | |
| 55 | void print_res(const Request& req, |
| 56 | const Response& res, |
| 57 | std::string route_tag, |
| 58 | uint64_t elapse_ms) { |
| 59 | for (uint32_t i = 0; i < res.predictions_size(); ++i) { |
| 60 | const SparsePrediction& prediction = res.predictions(i); |
| 61 | std::ostringstream oss; |
| 62 | for (uint32_t j = 0; j < prediction.categories_size(); ++j) { |
| 63 | oss << prediction.categories(j) << " "; |
| 64 | } |
| 65 | LOG(INFO) << "Receive result " << oss.str(); |
| 66 | } |
| 67 | |
| 68 | LOG(INFO) << "Succ call predictor[sparse_format], the tag is: " << route_tag |
| 69 | << ", elapse_ms: " << elapse_ms; |
| 70 | } |
| 71 | |
| 72 | int main(int argc, char** argv) { |
| 73 | PredictorApi api; |