Skip to content

Commit deb5dee

Browse files
Merge the existing parameters when updating connectors (#2784) (#2787)
* merge the existing parameters when updating connectors Signed-off-by: Xun Zhang <[email protected]> * add more details in sagemaker model for batch inference Signed-off-by: Xun Zhang <[email protected]> --------- Signed-off-by: Xun Zhang <[email protected]> (cherry picked from commit e16f38a) Co-authored-by: Xun Zhang <[email protected]>
1 parent bd322cf commit deb5dee

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

common/src/main/java/org/opensearch/ml/common/connector/HttpConnector.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ public void update(MLCreateConnectorInput updateContent, Function<String, String
287287
this.protocol = updateContent.getProtocol();
288288
}
289289
if (updateContent.getParameters() != null && updateContent.getParameters().size() > 0) {
290-
this.parameters = updateContent.getParameters();
290+
getParameters().putAll(updateContent.getParameters());
291291
}
292292
if (updateContent.getCredential() != null && updateContent.getCredential().size() > 0) {
293293
this.credential = updateContent.getCredential();

docs/remote_inference_blueprints/batch_inference_sagemaker_connector_blueprint.md

+12
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ Read more details on https://opensearch.org/docs/latest/ml-commons-plugin/remote
55
Integrate the SageMaker Batch Transform API using the connector below with a new action type "batch_predict".
66
For more details to use batch transform to run inference with Amazon SageMaker, please refer to https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform.html.
77

8+
SageMaker uses your pre-created model to execute the batch transform job. For creating your model in SageMaker
9+
that supports batch transform, please refer to https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateModel.html. In this example, the following primary
10+
container is used to create the text-embedding DJL model in SageMaker.
11+
```json
12+
"ModelName": "DJL-Text-Embedding-Model-imageforjsonlines",
13+
"PrimaryContainer": {
14+
"Environment": {
15+
"SERVING_LOAD_MODELS" : "djl://ai.djl.huggingface.pytorch/sentence-transformers/all-MiniLM-L6-v2"
16+
},
17+
"Image": "763104351884.dkr.ecr.us-east-1.amazonaws.com/djl-inference:0.22.1-cpu-full"
18+
}
19+
```
820
#### 1. Create your Model connector and Model group
921

1022
##### 1a. Register Model group

0 commit comments

Comments
 (0)