-
Notifications
You must be signed in to change notification settings - Fork 4
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
🔱 SageMaker Jumpstart #6355
Labels
spike
investigation, discovery into a thing
Comments
4 tasks
User is working on the solution, and we will support their efforts |
Jumpstart model has been accessed from opensearch in Cloud Platform (thread). A separate async model was deployed, accessible using this script: import json
from time import sleep
import boto3
from sagemaker.jumpstart.model import JumpStartModel
from sagemaker.predictor import Predictor
s3_client = boto3.client("s3", region_name="eu-west-2")
sagemaker_client = boto3.client("sagemaker-runtime", region_name="eu-west-2")
s3_input_path = "s3://mojap-compute-sagemaker-jumpstart-development/input/query.json"
s3_client.put_object(
Bucket="mojap-compute-sagemaker-jumpstart-development",
Key="input/query.json",
Body=json.dumps({"inputs": "What is the capital of France?"}),
)
endpoint = "test-ep-gqzgzrxs"
predictor = Predictor(endpoint, sagemaker_client)
response = sagemaker_client.invoke_endpoint_async(
EndpointName=endpoint,
InputLocation=s3_input_path,
InvocationTimeoutSeconds=120,
ContentType="application/json",
)
# retrieve the results from the output location (response["OutputLocation"])
output_key = response["OutputLocation"].split(
"s3://mojap-compute-sagemaker-jumpstart-development/"
)[-1]
print(output_key)
sleep(5)
output = s3_client.get_object(
Bucket="mojap-compute-sagemaker-jumpstart-development",
Key=output_key,
)
print(output["Body"].read().decode("utf-8")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context
This came out of the following request made to Cloud Platform: ministryofjustice/cloud-platform#6549
Proposal
We experiment in allowing users to create SageMaker JumpStart instances and endpoints using terraform in our Compute production account.
Outcomes:
Spike requirements
Ops, 2 Days
Definition of Done
Example
The text was updated successfully, but these errors were encountered: