-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding blueprint examples for remote inference #1155
Conversation
Signed-off-by: Dhrubo Saha <dhrubo@amazon.com>
@@ -0,0 +1,28 @@ | |||
```json | |||
{ | |||
"name": "OpenAI Connector", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"name": "OpenAI Connector", | |
"name": "OpenAI Completions Connector", |
Signed-off-by: Dhrubo Saha <dhrubo@amazon.com>
-0.52246094, | ||
-1.2714844, | ||
1.8076172, | ||
0.13842773, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let keep the first five embedding float values, then use ...
to repreent the others. It seems not helping too much by showing thousands of floats.
"headers": { | ||
"content-type": "application/json" | ||
}, | ||
"url": "https://runtime.sagemaker.${parameters.region}.amazonaws.com/endpoints/lmi-model-2023-06-24-01-35-32-275/invocations", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this URL , this is just our internal Sagemaker endpiont.
"url": "https://runtime.sagemaker.${parameters.region}.amazonaws.com/endpoints/lmi-model-2023-06-24-01-35-32-275/invocations", | |
"url": "<PLEASE ADD YOUR Sagemaker URL>", |
"content-type": "application/json" | ||
}, | ||
"url": "https://runtime.sagemaker.${parameters.region}.amazonaws.com/endpoints/lmi-model-2023-06-24-01-35-32-275/invocations", | ||
"request_body": "[\"${parameters.inputs}\"]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This request body is just from our test sagemaker embedding model. User should add their own body template.
"request_body": "[\"${parameters.inputs}\"]" | |
"request_body": "<PLEASE ADD YOUR REQUEST BODY>" |
} | ||
``` | ||
|
||
### Corresponding Predict request example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we can't predict what's the model deployed to Sagemaker on user side, so we should remove the predict request example and sample response.
```json | ||
POST /_plugins/_ml/connectors/_create | ||
{ | ||
"name": "sagemaker: embedding", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"name": "sagemaker: embedding", | |
"name": "<YOUR MODEL NAME>", |
POST /_plugins/_ml/connectors/_create | ||
{ | ||
"name": "sagemaker: embedding", | ||
"description": "Test connector for Sagemaker embedding model", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description": "Test connector for Sagemaker embedding model", | |
"description": "<YOUR MODEL DESCRIPTION>", |
Codecov Report
@@ Coverage Diff @@
## 2.x #1155 +/- ##
============================================
- Coverage 78.95% 78.91% -0.04%
+ Complexity 2119 2116 -3
============================================
Files 167 167
Lines 8633 8633
Branches 869 869
============================================
- Hits 6816 6813 -3
- Misses 1422 1427 +5
+ Partials 395 393 -2
Flags with carried forward coverage won't be shown. Click here to find out more. |
@@ -0,0 +1,92 @@ | |||
### OpenAI connector blueprint example for chat: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explain that this blueprint is created from OpenAI doc,
and example is from OpenAI doc https://platform.openai.com/docs/api-reference/chat?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for other examples, we should use the exact same example from OpenAI and Cohere official document. And we should put their doc link here so community user can refer to .
Signed-off-by: Dhrubo Saha <dhrubo@amazon.com>
"content-type": "application/json" | ||
}, | ||
"url": "<PLEASE ADD YOUR Sagemaker MODEL ENDPOINT URL>", | ||
"request_body": "<PLEASE ADD YOUR REQUEST BODY. Example: [\"${parameters.inputs}\"]>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about just "{parameters.input}"
? Add [
and ]
looks confusing as that's only for embedding generation , not a general one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean: ${parameters.inputs}
?
Signed-off-by: Dhrubo Saha <dhrubo@amazon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks a lot
* adding blueprint examples for remote inference Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * updating blue prints with sample response Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * addressing comments Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * addressed comments for sagemaker Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> --------- Signed-off-by: Dhrubo Saha <dhrubo@amazon.com>
* adding blueprint examples for remote inference Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * updating blue prints with sample response Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * addressing comments Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * addressed comments for sagemaker Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> --------- Signed-off-by: Dhrubo Saha <dhrubo@amazon.com>
Description
[adding blueprint examples for remote inference]
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.