Skip to content

Commit 61245aa

Browse files
authored
update notebooks (#168)
* update notebooks to use pypi install * fix install * fix region
1 parent e4ad556 commit 61245aa

File tree

5 files changed

+22
-58
lines changed

5 files changed

+22
-58
lines changed

example_notebooks/inference_and_resource_chaining.ipynb

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
"metadata": {},
7575
"outputs": [],
7676
"source": [
77-
"# Uninstall previous version of sagemaker_core and restart kernel\n",
78-
"!pip uninstall sagemaker_core -y"
77+
"# Uninstall previous version of sagemaker-core and restart kernel\n",
78+
"!pip uninstall sagemaker-core -y"
7979
]
8080
},
8181
{
@@ -84,20 +84,9 @@
8484
"metadata": {},
8585
"outputs": [],
8686
"source": [
87-
"# Make dist/ directory to hold the sagemaker_core beta distribution file\n",
88-
"!mkdir dist"
89-
]
90-
},
91-
{
92-
"cell_type": "code",
93-
"execution_count": null,
94-
"metadata": {},
95-
"outputs": [],
96-
"source": [
97-
"# Download and Install the latest version of sagemaker_core\n",
98-
"!aws s3 cp s3://sagemaker-core-beta-artifacts/sagemaker_core-latest.tar.gz dist/\n",
87+
"# Install the latest version of sagemaker-core\n",
9988
"\n",
100-
"!pip install dist/sagemaker_core-latest.tar.gz"
89+
"!pip install sagemaker-core --upgrade"
10190
]
10291
},
10392
{
@@ -106,8 +95,8 @@
10695
"metadata": {},
10796
"outputs": [],
10897
"source": [
109-
"# Check the version of sagemaker_core\n",
110-
"!pip show -v sagemaker_core"
98+
"# Check the version of sagemaker-core\n",
99+
"!pip show -v sagemaker-core"
111100
]
112101
},
113102
{

example_notebooks/intelligent_defaults_and_logging.ipynb

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"outputs": [],
108108
"source": [
109109
"# Uninstall previous version of sagemaker_core and restart kernel\n",
110-
"!pip uninstall sagemaker_core -y"
110+
"!pip uninstall sagemaker-core -y"
111111
]
112112
},
113113
{
@@ -116,20 +116,9 @@
116116
"metadata": {},
117117
"outputs": [],
118118
"source": [
119-
"# Make dist/ directory to hold the sagemaker_core beta distribution file\n",
120-
"!mkdir dist"
121-
]
122-
},
123-
{
124-
"cell_type": "code",
125-
"execution_count": null,
126-
"metadata": {},
127-
"outputs": [],
128-
"source": [
129-
"# Download and Install the latest version of sagemaker_core\n",
130-
"!aws s3 cp s3://sagemaker-core-beta-artifacts/sagemaker_core-latest.tar.gz dist/\n",
119+
"# Install the latest version of sagemaker_core\n",
131120
"\n",
132-
"!pip install dist/sagemaker_core-latest.tar.gz"
121+
"!pip install sagemaker-core --upgrade"
133122
]
134123
},
135124
{
@@ -139,7 +128,7 @@
139128
"outputs": [],
140129
"source": [
141130
"# Check the version of sagemaker_core\n",
142-
"!pip show -v sagemaker_core"
131+
"!pip show -v sagemaker-core"
143132
]
144133
},
145134
{

example_notebooks/sagemaker-core-llama-3-8B-speculative-decoding.ipynb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"outputs": [],
3333
"source": [
3434
"%pip install pip --upgrade --quiet\n",
35-
"%pip install dist/sagemaker-core-0.1.8.tar.gz huggingface_hub --quiet"
35+
"%pip install sagemaker-core huggingface_hub --quiet"
3636
]
3737
},
3838
{
@@ -63,9 +63,7 @@
6363
"\n",
6464
"SM_SESSION = Session()\n",
6565
"\n",
66-
"REGION = \"us-east-1\"\n",
67-
"REGION_NAME = REGION if REGION else SM_SESSION._region_name\n",
68-
"\n",
66+
"REGION = SM_SESSION._region_name\n",
6967
"\n",
7068
"SM_DEFAULT_EXECUTION_ROLE_ARN = get_execution_role()\n",
7169
"\n",
@@ -74,7 +72,7 @@
7472
"#INSTANCE_TYPE = \"ml.p4d.24xlarge\" \n",
7573
"\n",
7674
"# See https://github.com/aws/deep-learning-containers/blob/master/available_images.md#large-model-inference-containers for lastest DLC. \n",
77-
"container_image_uri = \"763104351884.dkr.ecr.us-east-1.amazonaws.com/djl-inference:0.29.0-tensorrtllm0.11.0-cu124\"\n",
75+
"container_image_uri = f\"763104351884.dkr.ecr.{REGION}.amazonaws.com/djl-inference:0.29.0-tensorrtllm0.11.0-cu124\"\n",
7876
"\n",
7977
"default_bucket = SM_SESSION.default_bucket()\n",
8078
"\n",
@@ -933,9 +931,9 @@
933931
],
934932
"instance_type": "ml.t3.medium",
935933
"kernelspec": {
936-
"display_name": "conda_pytorch_p310",
934+
"display_name": "Python 3",
937935
"language": "python",
938-
"name": "conda_pytorch_p310"
936+
"name": "python3"
939937
},
940938
"language_info": {
941939
"codemirror_mode": {

example_notebooks/sagemaker-core-llama-3-8B.ipynb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"outputs": [],
3030
"source": [
3131
"%pip install pip --upgrade --quiet\n",
32-
"%pip install dist/sagemaker-core-0.1.8.tar.gz huggingface_hub --quiet"
32+
"%pip install sagemaker-core huggingface_hub --quiet"
3333
]
3434
},
3535
{
@@ -60,15 +60,14 @@
6060
"\n",
6161
"SM_SESSION = Session()\n",
6262
"\n",
63-
"REGION = \"us-east-1\"\n",
64-
"REGION_NAME = REGION if REGION else SM_SESSION._region_name\n",
63+
"REGION = SM_SESSION._region_name\n",
6564
"\n",
6665
"SM_DEFAULT_EXECUTION_ROLE_ARN = get_execution_role()\n",
6766
"\n",
6867
"INSTANCE_TYPE = \"ml.g5.12xlarge\" \n",
6968
"\n",
7069
"# See https://github.com/aws/deep-learning-containers/blob/master/available_images.md#large-model-inference-containers for lastest DLC. \n",
71-
"container_image_uri = \"763104351884.dkr.ecr.us-east-1.amazonaws.com/djl-inference:0.29.0-tensorrtllm0.11.0-cu124\"\n",
70+
"container_image_uri = f\"763104351884.dkr.ecr.{REGION}.amazonaws.com/djl-inference:0.29.0-tensorrtllm0.11.0-cu124\"\n",
7271
"\n",
7372
"default_bucket = SM_SESSION.default_bucket()\n",
7473
"\n",

example_notebooks/sagemaker_core_overview.ipynb

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"outputs": [],
9494
"source": [
9595
"# Uninstall previous version of sagemaker_core and restart kernel\n",
96-
"!pip uninstall sagemaker_core -y"
96+
"!pip uninstall sagemaker-core -y"
9797
]
9898
},
9999
{
@@ -102,20 +102,9 @@
102102
"metadata": {},
103103
"outputs": [],
104104
"source": [
105-
"# Make dist/ directory to hold the sagemaker_core beta distribution file\n",
106-
"!mkdir dist"
107-
]
108-
},
109-
{
110-
"cell_type": "code",
111-
"execution_count": null,
112-
"metadata": {},
113-
"outputs": [],
114-
"source": [
115-
"# Download and Install the latest version of sagemaker_core\n",
116-
"!aws s3 cp s3://sagemaker-core-beta-artifacts/sagemaker_core-latest.tar.gz dist/\n",
105+
"# Install the latest version of sagemaker_core\n",
117106
"\n",
118-
"!pip install dist/sagemaker_core-latest.tar.gz"
107+
"!pip install sagemaker-core --upgrade"
119108
]
120109
},
121110
{
@@ -125,7 +114,7 @@
125114
"outputs": [],
126115
"source": [
127116
"# Check the version of sagemaker_core\n",
128-
"!pip show -v sagemaker_core"
117+
"!pip show -v sagemaker-core"
129118
]
130119
},
131120
{

0 commit comments

Comments
 (0)