Created
January 20, 2019 17:46
-
-
Save sakshamsaxena/1ffbc689aa198c63c108a62bfa07f3ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const protoLoader = require('@grpc/proto-loader'); | |
const grpcLibrary = require('grpc'); | |
const options = { | |
includeDirs: [ | |
'./tensorflow_serving/apis/', | |
'./tensorflow_serving/config/', | |
'./tensorflow_serving/core/', | |
'./tensorflow_serving/util/', | |
'./tensorflow_serving/sources/', | |
'./tensorflow/core/example/', | |
'./tensorflow/core/lib/', | |
'./tensorflow/core/framework/', | |
'./tensorflow/core/protobuf/', | |
'./' | |
] | |
} | |
const packageDefinition = protoLoader.loadSync('prediction_service.proto', options); | |
console.log(Object.keys(packageDefinition)) // Returned all correctly loaded packages | |
const packageObject = grpcLibrary.loadPackageDefinition(packageDefinition); | |
console.log(packageObject) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment