| 46 | } |
| 47 | |
| 48 | void ParseProtoFile(char* proto_buffer, size_t proto_buffer_length) { |
| 49 | // remove all the " and \n character |
| 50 | size_t fill = 0; |
| 51 | for (size_t i = 0; i < proto_buffer_length; ++i) { |
| 52 | if (proto_buffer[i] != '\"' && proto_buffer[i] != '\n') { |
| 53 | proto_buffer[fill++] = proto_buffer[i]; |
| 54 | } |
| 55 | } |
| 56 | proto_buffer[fill] = '\0'; |
| 57 | } |
| 58 | |
| 59 | int InitModelConfig(ModelConfig& model_config, std::string proto_file, std::string model_file) { |
| 60 | FILE* fp = fopen(proto_file.c_str(), "r"); |