File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
src/main/java/com/github/tadayosi/tensorflow/serving/client Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 44import java .util .Optional ;
55import java .util .Properties ;
66
7+ import io .grpc .ChannelCredentials ;
78import org .slf4j .Logger ;
89import org .slf4j .LoggerFactory ;
910
@@ -18,13 +19,14 @@ public class Configuration {
1819 public static final String CREDENTIALS = "credentials" ;
1920
2021 private final Optional <String > target ;
21- private final Optional <String > credentials ;
22+ private final Optional <ChannelCredentials > credentials ;
2223
2324 private Configuration () {
2425 Properties props = loadProperties ();
2526
2627 this .target = loadProperty (TARGET , props );
27- this .credentials = loadProperty (CREDENTIALS , props );
28+ //this.credentials = loadProperty(CREDENTIALS, props);
29+ this .credentials = Optional .empty ();
2830 }
2931
3032 static Properties loadProperties () {
@@ -59,7 +61,7 @@ public Optional<String> getTarget() {
5961 return target ;
6062 }
6163
62- public Optional <String > getCredentials () {
64+ public Optional <ChannelCredentials > getCredentials () {
6365 return credentials ;
6466 }
6567}
Original file line number Diff line number Diff line change @@ -41,7 +41,8 @@ public GetModelStatus.GetModelStatusResponse getModelStatus(GetModelStatus.GetMo
4141 }
4242
4343 @ Override
44- public GetModelMetadata .GetModelMetadataResponse getModelMetadata (GetModelMetadata .GetModelMetadataRequest request ) {
44+ public GetModelMetadata .GetModelMetadataResponse getModelMetadata (
45+ GetModelMetadata .GetModelMetadataRequest request ) {
4546 return predictionService .getModelMetadata (request );
4647 }
4748
@@ -65,22 +66,22 @@ public static class Builder {
6566 private final Configuration configuration = Configuration .load ();
6667
6768 private Optional <String > target = configuration .getTarget ();
68- private Optional <String > credentials = configuration .getCredentials ();
69+ private Optional <ChannelCredentials > credentials = configuration .getCredentials ();
6970
7071 public Builder target (String target ) {
7172 this .target = Optional .of (target );
7273 return this ;
7374 }
7475
75- public Builder credentials (String credentials ) {
76+ public Builder credentials (ChannelCredentials credentials ) {
7677 this .credentials = Optional .of (credentials );
7778 return this ;
7879 }
7980
8081 public TensorFlowServingClient build () {
8182 return new TensorFlowServingClient (
8283 target .orElse (DEFAULT_TARGET ),
83- InsecureChannelCredentials .create ());
84+ credentials . orElse ( InsecureChannelCredentials .create () ));
8485 }
8586 }
8687}
You can’t perform that action at this time.
0 commit comments