<jupyter_start><jupyter_text>Create Endpoint from Job  Disclaimer!You should update in conf.py the following variables:- training_job_name- model_data<jupyter_code>import conf
import sagemaker
from sagemaker import get_execution_role
from sagemaker.model import Model

role = get_execution_role()

print(role)

bucket = conf.SESSION_BUCKET
sess = sagemaker.Session(default_bucket=bucket)
model_name = sess.create_model_from_job(training_job_name=conf.training_job_name,
                                   name=conf.model_name,
                                   role=role,
)
model = Model(model_data=conf.model_data,
                    image=conf.container_image,
                    role=role,
                    sagemaker_session=sess)
object_detector = model.deploy(initial_instance_count=conf.initial_instance_count,
                               instance_type=conf.deploy_instance_type,
                               endpoint_name=conf.endpoint_name)
sess.sagemaker_client.describe_endpoint(EndpointName=conf.endpoint_name)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06591337099811675, 'fraction_numerical': 0.0, 'mean_word_length': 2.9812734082397006, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '500657', 'license': 'Apache-2.0', 'n_tokens_mistral': 311, 'n_tokens_neox': 294, 'n_words': 46, 'path': '2.0-amazon-sagemaker/2.2-hardhat-object-detection/03-CreateEndpointFromJob.ipynb', 'repo_name': 'obernardocosta/aws-ml-demos', 'size': '1062'}