Closed davezen1 closed 2 years ago
If model was created with region endpoint then endpoint should have region:
String endpoint = "https://us-east4-ml.googleapis.com/v1/projects/" + String.format("%s/models/%s/versions/%s:predict", PROJECT, MODEL, VERSION);
Needed to change the credential to include scope, otherwise received 'invalid_scope' 400 Bad Request
GoogleCredential credential = GoogleCredential.getApplicationDefault().createScoped(java.util.Arrays.asList("https://www.googleapis.com/auth/cloud-platform"));
If model was created with region endpoint then endpoint should have region:
Needed to change the credential to include scope, otherwise received 'invalid_scope' 400 Bad Request
GoogleCredential credential = GoogleCredential.getApplicationDefault().createScoped(java.util.Arrays.asList("https://www.googleapis.com/auth/cloud-platform"));