-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
Support SageMaker Endpoints in chat #197
Conversation
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.
We should have at least basic info in the user docs to indicate how people can start using models in Jupyter AI via SageMaker.
I've added SageMaker Endpoints in the user documentation. |
Co-authored-by: Piyush Jain <piyushjain@duck.com>
Co-authored-by: Jason Weill <93281816+JasonWeill@users.noreply.github.com>
@JasonWeill Here are working request/response schemas for Request schema{"text_inputs":"<prompt>", "max_length":50, "num_return_sequences":3, "top_k":50, "top_p":0.95, "do_sample":true} Response schemagenerated_texts.[0] |
@JasonWeill |
The CI failure is not related to the changes here. |
* allow models from registry providers in chat * support language model fields * add json content handler for SM Endpoints * remove console log * rename variables for clarity * add user documentation for SageMaker Endpoints * update docstring Co-authored-by: Piyush Jain <piyushjain@duck.com> * remove redundant height attribute Co-authored-by: Jason Weill <93281816+JasonWeill@users.noreply.github.com> * fix memo dependencies * Updated headers for settings panel sections * Fixing CI failure for check-release --------- Co-authored-by: Piyush Jain <piyushjain@duck.com> Co-authored-by: Jason Weill <93281816+JasonWeill@users.noreply.github.com>
* allow models from registry providers in chat * support language model fields * add json content handler for SM Endpoints * remove console log * rename variables for clarity * add user documentation for SageMaker Endpoints * update docstring Co-authored-by: Piyush Jain <piyushjain@duck.com> * remove redundant height attribute Co-authored-by: Jason Weill <93281816+JasonWeill@users.noreply.github.com> * fix memo dependencies * Updated headers for settings panel sections * Fixing CI failure for check-release --------- Co-authored-by: Piyush Jain <piyushjain@duck.com> Co-authored-by: Jason Weill <93281816+JasonWeill@users.noreply.github.com>
Description
Allows for usage of language models hosted on SageMaker Endpoints. The only constraint is that both the request and response of the model are in JSON.
Screen.Recording.2023-05-30.at.10.44.09.AM.mov
Providers may now declare fields, which are keyword arguments expected by the constructor. Each field is declared via a
Field
object, which is defined as follows:The backend stores the values of each fields under
config.fields.[<model-id>]
, where<model-id>
is the global model ID of a model. The backend will also automatically read this config object and pass fields for a model to a model provider's constructor as keyword arguments.In the case of SageMaker Endpoints (SMEP), there are 3 additional fields declared:
The constructor of the SMEP provider has been modified to accept two new keyword arguments:
request_schema
andresponse_path
.request_schema
is a JSON string. Any values that match the exact literal"<prompt>"
are substituted with the value of the prompt. For example, when usingflan-t5-xl
on SMEP via SM Jumpstart, the request schema should be{"text_inputs":"<prompt>"}
response_path
is a JSON path as defined in the specification. So for example, when usingflan-t5-xl
on SMEP, this should begenerated_texts.[0]
.The change to the SMEP provider constructor should enable usage in magics fairly easily, but unfortunately I cannot finish this before my vacation tomorrow.
Follow-up items