<jupyter_start><jupyter_text>Model Creation<jupyter_code>from sagemaker.model import Model
from sagemaker.predictor import RealTimePredictor

model_data = f's3://{bucket_name}/{prefix}/models/{s3_folder}/{model_file_name}.tar.gz'
sm_model_name = 'sentiment-r1-1'

torchserve_model = Model(model_data = model_data, 
                         image = image,
                         role  = role,
                         predictor_cls=RealTimePredictor,
                         name  = sm_model_name)<jupyter_output><empty_output><jupyter_text>Model Deployment<jupyter_code>endpoint_name = sm_model_name
#Change the initial_instance_count to the number of instances you want to be launched.
predictor = torchserve_model.deploy(instance_type='ml.c5.2xlarge',
                                    initial_instance_count=1,
                                    endpoint_name = endpoint_name)<jupyter_output>---------------!
{'fraction_non_alphanumeric': 0.09487459105779716, 'fraction_numerical': 0.007633587786259542, 'mean_word_length': 2.5172413793103448, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '593041', 'license': 'MIT', 'n_tokens_mistral': 279, 'n_tokens_neox': 261, 'n_words': 43, 'path': 'legacy/torchserve/legacy/notebooks/sent_class_deploy.ipynb', 'repo_name': 'vontell/dynabench', 'size': '917'}