I have a log of grpc messages for a TensorflowServing system looking like this:
model_spec:{name:"model_name"} inputs:{key:"args_0" value:{dtype:DT_STRING tensor_shape:{dim:{size:1}} string_val:"example input"}} inputs:{key:"args_1" value:{dtype:DT_STRING tensor_shape:{dim:{size:1}} string_val:"another example input"}} inputs:{key:"args_3" value:{dtype:DT_FLOAT tensor_shape:{dim:{size:1}} float_val:374969}}
I suspect this is a protobuf format string (but I might be wrong) and I would like to turn it into a python dictionary (something like this but I am flexible):
{
"model_spec":{"name":"model_name"},
"inputs":{
"args_0": "example input",
"args_1": "another example input",
"args_3": 374969
}
}
Are there any libraries that can help me here? My problem is that I don't have any schema for this message (as required in this stackoverflow question). I tried parsing this with regular expressions but I hope there might be a better way.