Skip to content

Commit 80423c9

Browse files
committed
notebooks2
1 parent cc8c21e commit 80423c9

9 files changed

+38
-29
lines changed

introduction_to_amazon_algorithms/jumpstart-foundation-models/domain-adaption-finetuning-gpt-j-6b.ipynb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
{
1212
"attachments": {},
1313
"cell_type": "markdown",
14+
"id": "496fab09",
1415
"metadata": {},
1516
"source": [
1617
"---\n",
@@ -762,6 +763,7 @@
762763
{
763764
"attachments": {},
764765
"cell_type": "markdown",
766+
"id": "5eb59a9c",
765767
"metadata": {},
766768
"source": [
767769
"## Notebook CI Test Results\n",

introduction_to_amazon_algorithms/jumpstart-foundation-models/text-generation-chatbot.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@
203203
"from sagemaker.predictor import Predictor\n",
204204
"\n",
205205
"\n",
206-
"model = JumpStartModel(model_id=model_config.model_id, **model_config.model_kwargs)\n",
206+
"model = JumpStartModel(\n",
207+
" model_id=model_config.model_id, model_version=\"1.*\", **model_config.model_kwargs\n",
208+
")\n",
207209
"predictor = model.deploy()"
208210
]
209211
},

introduction_to_amazon_algorithms/jumpstart-foundation-models/text-generation-few-shot-learning.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
"source": [
168168
"model_id, model_version, = (\n",
169169
" \"huggingface-textgeneration1-gpt-j-6b\",\n",
170-
" \"*\",\n",
170+
" \"1.*\",\n",
171171
")"
172172
]
173173
},
@@ -239,7 +239,7 @@
239239
"outputs": [],
240240
"source": [
241241
"# model_version=\"*\" fetches the latest version of the model\n",
242-
"model_id, model_version = model_dropdown.value, \"*\""
242+
"model_id, model_version = model_dropdown.value, \"1.*\""
243243
]
244244
},
245245
{
@@ -524,7 +524,7 @@
524524
" \"\"\"[Original]: Amazon scientists, in collaboration with researchers from the University of Sheffield, are making a large-scale fact extraction and verification dataset publicly available for the first time. The dataset, comprising more than 185,000 evidence-backed claims, is being made available to hopefully catalyze research and development that addresses the problems of fact extraction and verification in software applications or cloud-based services that perform automatic information extraction.\n",
525525
" [Summary]: Amazon and University researchers make fact extraction and verification dataset publicly available.\n",
526526
" ###\n",
527-
" [Original]: Prime members in the U.S. can get even more delivered to their door with a Prime membership. Members can now enjoy one year of Grubhub+ valued at $9.99 per month for free\u2014at no added cost to their Prime membership. To activate this deal, visit amazon.com/grubhub. This new offer includes unlimited, $0 food delivery fees on orders over $12 as well as exclusive perks for Grubhub+ members and rewards like free food and order discounts. Plus, diners can \u201ceat good while doing good\u201d by opting into Grubhub\u2019s Donate the Change program, a donation-matching initiative that raised more than $25 million in 2021 alone, benefiting more than 20 charitable organizations across the country.\n",
527+
" [Original]: Prime members in the U.S. can get even more delivered to their door with a Prime membership. Members can now enjoy one year of Grubhub+ valued at $9.99 per month for free—at no added cost to their Prime membership. To activate this deal, visit amazon.com/grubhub. This new offer includes unlimited, $0 food delivery fees on orders over $12 as well as exclusive perks for Grubhub+ members and rewards like free food and order discounts. Plus, diners can “eat good while doing good by opting into Grubhub’s Donate the Change program, a donation-matching initiative that raised more than $25 million in 2021 alone, benefiting more than 20 charitable organizations across the country.\n",
528528
" [Summary]: Prime members in the U.S. can enjoy one year of Grubhub+ for free, with no food-delivery fees on eligible orders.\n",
529529
" ###\n",
530530
" [Original]: {text}\n",
@@ -695,7 +695,7 @@
695695
},
696696
"outputs": [],
697697
"source": [
698-
"sentence = \"David Melvin is an investment and financial services professional at CITIC CLSA with over 30 years\u2019 experience in investment banking and private equity. He is currently a Senior Adviser of CITIC CLSA.\""
698+
"sentence = \"David Melvin is an investment and financial services professional at CITIC CLSA with over 30 years experience in investment banking and private equity. He is currently a Senior Adviser of CITIC CLSA.\""
699699
]
700700
},
701701
{
@@ -1179,13 +1179,13 @@
11791179
"outputs": [],
11801180
"source": [
11811181
"prompts = [\n",
1182-
" \"\"\"Hugging Face a r\u00e9volutionn\u00e9 le NLP.\n",
1182+
" \"\"\"Hugging Face a révolutionné le NLP.\n",
11831183
" Translation: Hugging Face revolutionized NLP.\n",
11841184
" ###\n",
11851185
" Cela est incroyable!\n",
11861186
" Translation: This is unbelievable!\n",
11871187
" ###\n",
1188-
" D\u00e9sol\u00e9 je ne peux pas.\n",
1188+
" Désolé je ne peux pas.\n",
11891189
" Translation: Sorry but I cannot.\n",
11901190
" ###\n",
11911191
" {sentence}\n",
@@ -1921,4 +1921,4 @@
19211921
},
19221922
"nbformat": 4,
19231923
"nbformat_minor": 5
1924-
}
1924+
}

introduction_to_amazon_algorithms/jumpstart-foundation-models/text-generation-open-llama.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
},
4444
"outputs": [],
4545
"source": [
46-
"model_id, model_version, = (\n",
46+
"model_id, model_version = (\n",
4747
" \"huggingface-textgeneration-open-llama\",\n",
48-
" \"*\",\n",
48+
" \"2.*\",\n",
4949
")"
5050
]
5151
},
@@ -61,7 +61,7 @@
6161
"from sagemaker.jumpstart.model import JumpStartModel\n",
6262
"from sagemaker.serializers import JSONSerializer\n",
6363
"\n",
64-
"my_model = JumpStartModel(model_id=model_id)\n",
64+
"my_model = JumpStartModel(model_id=model_id, model_version=model_version)\n",
6565
"predictor = my_model.deploy()\n",
6666
"\n",
6767
"predictor.serializer = JSONSerializer()\n",

introduction_to_amazon_algorithms/jumpstart-foundation-models/text2text-generation-Batch-Transform.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
"outputs": [],
161161
"source": [
162162
"model_id = \"huggingface-text2text-flan-t5-large\"\n",
163-
"model_version = \"*\""
163+
"model_version = \"1.*\""
164164
]
165165
},
166166
{
@@ -224,7 +224,7 @@
224224
"outputs": [],
225225
"source": [
226226
"# model_version=\"*\" fetches the latest version of the model\n",
227-
"model_id, model_version = model_dropdown.value, \"*\""
227+
"model_id, model_version = model_dropdown.value, \"1.*\""
228228
]
229229
},
230230
{

introduction_to_amazon_algorithms/jumpstart-foundation-models/text2text-generation-bloomz.ipynb

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
{
1212
"attachments": {},
1313
"cell_type": "markdown",
14+
"id": "71a7d870",
1415
"metadata": {},
1516
"source": [
1617
"---\n",
@@ -162,7 +163,7 @@
162163
"source": [
163164
"model_id, model_version, = (\n",
164165
" \"huggingface-textgeneration1-bloomz-7b1-fp16\",\n",
165-
" \"*\",\n",
166+
" \"1.*\",\n",
166167
")"
167168
]
168169
},
@@ -232,7 +233,7 @@
232233
"outputs": [],
233234
"source": [
234235
"# model_version=\"*\" fetches the latest version of the model\n",
235-
"model_id, model_version = model_dropdown.value, \"*\""
236+
"model_id, model_version = model_dropdown.value, \"1.*\""
236237
]
237238
},
238239
{
@@ -540,7 +541,7 @@
540541
"metadata": {},
541542
"outputs": [],
542543
"source": [
543-
"text = \"\"\"\u4e00\u4e2a\u4f20\u5947\u7684\u5f00\u7aef\uff0c\u4e00\u4e2a\u4e0d\u706d\u7684\u795e\u8bdd\uff0c\u8fd9\u4e0d\u4ec5\u4ec5\u662f\u4e00\u90e8\u7535\u5f71\uff0c\u800c\u662f\u4f5c\u4e3a\u4e00\u4e2a\u8d70\u8fdb\u65b0\u65f6\u4ee3\u7684\u6807\u7b7e\uff0c\u6c38\u8fdc\u5f6a\u70b3\u53f2\u518c\u3002\"\"\""
544+
"text = \"\"\"一个传奇的开端,一个不灭的神话,这不仅仅是一部电影,而是作为一个走进新时代的标签,永远彪炳史册。\"\"\""
544545
]
545546
},
546547
{
@@ -697,7 +698,7 @@
697698
"source": [
698699
"sentence = \"\"\"Amazon Web Services (AWS) has announced nine major new updates for its cloud-based machine learning platform, SageMaker.\n",
699700
"SageMaker aims to provide a machine learning service which can be used to build, train, and deploy ML models for virtually any use case.\n",
700-
"During this year\u2019s re:Invent conference, AWS made several announcements to further improve SageMaker\u2019s capabilities.\"\"\""
701+
"During this year’s re:Invent conference, AWS made several announcements to further improve SageMaker’s capabilities.\"\"\""
701702
]
702703
},
703704
{
@@ -883,9 +884,9 @@
883884
"source": [
884885
"context = \"\"\"The newest and most innovative Kindle yet lets you take notes on millions of books and documents, write lists and journals, and more. \n",
885886
"\n",
886-
"For readers who have always wished they could write in their eBooks, Amazon\u2019s new Kindle lets them do just that. The Kindle Scribe is the first Kindle for reading and writing and allows users to supplement their books and documents with notes, lists, and more.\n",
887+
"For readers who have always wished they could write in their eBooks, Amazon’s new Kindle lets them do just that. The Kindle Scribe is the first Kindle for reading and writing and allows users to supplement their books and documents with notes, lists, and more.\n",
887888
"\n",
888-
"Here\u2019s everything you need to know about the Kindle Scribe, including frequently asked questions.\n",
889+
"Here’s everything you need to know about the Kindle Scribe, including frequently asked questions.\n",
889890
"\n",
890891
"The Kindle Scribe makes it easy to read and write like you would on paper \n",
891892
"\n",
@@ -1183,9 +1184,9 @@
11831184
"source": [
11841185
"article = \"\"\"The newest and most innovative Kindle yet lets you take notes on millions of books and documents, write lists and journals, and more. \n",
11851186
"\n",
1186-
"For readers who have always wished they could write in their eBooks, Amazon\u2019s new Kindle lets them do just that. The Kindle Scribe is the first Kindle for reading and writing and allows users to supplement their books and documents with notes, lists, and more.\n",
1187+
"For readers who have always wished they could write in their eBooks, Amazon’s new Kindle lets them do just that. The Kindle Scribe is the first Kindle for reading and writing and allows users to supplement their books and documents with notes, lists, and more.\n",
11871188
"\n",
1188-
"Here\u2019s everything you need to know about the Kindle Scribe, including frequently asked questions.\n",
1189+
"Here’s everything you need to know about the Kindle Scribe, including frequently asked questions.\n",
11891190
"\n",
11901191
"The Kindle Scribe makes it easy to read and write like you would on paper \n",
11911192
"\n",
@@ -1248,6 +1249,7 @@
12481249
{
12491250
"attachments": {},
12501251
"cell_type": "markdown",
1252+
"id": "3c8760a6",
12511253
"metadata": {},
12521254
"source": [
12531255
"## Notebook CI Test Results\n",
@@ -1796,4 +1798,4 @@
17961798
},
17971799
"nbformat": 4,
17981800
"nbformat_minor": 5
1799-
}
1801+
}

introduction_to_amazon_algorithms/jumpstart-foundation-models/text2text-generation-flan-t5-ul2.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
"source": [
158158
"model_id, model_version = (\n",
159159
" \"huggingface-text2text-flan-t5-xl\",\n",
160-
" \"*\",\n",
160+
" \"1.*\",\n",
161161
")"
162162
]
163163
},
@@ -227,7 +227,7 @@
227227
"outputs": [],
228228
"source": [
229229
"# model_version=\"*\" fetches the latest version of the model\n",
230-
"model_id, model_version = model_dropdown.value, \"*\""
230+
"model_id, model_version = model_dropdown.value, \"1.*\""
231231
]
232232
},
233233
{

introduction_to_amazon_algorithms/jumpstart-foundation-models/text2text-generation-flan-t5.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
"source": [
127127
"model_id, model_version = (\n",
128128
" \"huggingface-text2text-flan-t5-xl\",\n",
129-
" \"*\",\n",
129+
" \"1.*\",\n",
130130
")"
131131
]
132132
},
@@ -196,7 +196,7 @@
196196
"outputs": [],
197197
"source": [
198198
"# model_version=\"*\" fetches the latest version of the model\n",
199-
"model_id, model_version = model_dropdown.value, \"*\""
199+
"model_id, model_version = model_dropdown.value, \"1.*\""
200200
]
201201
},
202202
{

introduction_to_amazon_algorithms/jumpstart_text_generation/Amazon_JumpStart_Text_Generation.ipynb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
{
1212
"attachments": {},
1313
"cell_type": "markdown",
14+
"id": "983f8b47",
1415
"metadata": {},
1516
"source": [
1617
"---\n",
@@ -136,9 +137,10 @@
136137
},
137138
"outputs": [],
138139
"source": [
140+
"# Please use model_version as 2.* if you're using the open-llama model\n",
139141
"model_id, model_version, = (\n",
140142
" \"huggingface-textgeneration-gpt2\",\n",
141-
" \"*\",\n",
143+
" \"1.*\",\n",
142144
")"
143145
]
144146
},
@@ -216,7 +218,7 @@
216218
"outputs": [],
217219
"source": [
218220
"# model_version=\"*\" fetches the latest version of the model\n",
219-
"model_id, model_version = model_dropdown.value, \"*\"\n",
221+
"model_id, model_version = model_dropdown.value, \"1.*\"\n",
220222
"\n",
221223
"hub = {}\n",
222224
"HF_MODEL_ID = \"xlnet-base-cased\" # Pass any other HF_MODEL_ID from - https://huggingface.co/models?pipeline_tag=text-classification&sort=downloads\n",
@@ -462,6 +464,7 @@
462464
{
463465
"attachments": {},
464466
"cell_type": "markdown",
467+
"id": "7d3c18aa",
465468
"metadata": {},
466469
"source": [
467470
"## Notebook CI Test Results\n",
@@ -522,4 +525,4 @@
522525
},
523526
"nbformat": 4,
524527
"nbformat_minor": 5
525-
}
528+
}

0 commit comments

Comments
 (0)