Skip to content

Changing the model_version for the text generation notebooks #4472

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

Merged
merged 3 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
"source": [
"model_id, model_version, = (\n",
" \"huggingface-textgeneration1-bloomz-176b-fp16\",\n",
" \"*\",\n",
" \"1.*\",\n",
")"
]
},
Expand Down Expand Up @@ -265,7 +265,7 @@
"outputs": [],
"source": [
"# model_version=\"*\" fetches the latest version of the model\n",
"model_id, model_version = model_dropdown.value, \"*\""
"model_id, model_version = model_dropdown.value, \"1.*\""
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "496fab09",
"metadata": {},
"source": [
"---\n",
Expand Down Expand Up @@ -120,7 +121,7 @@
"metadata": {},
"outputs": [],
"source": [
"model_id, model_version = \"huggingface-textgeneration1-gpt-j-6b\", \"*\""
"model_id, model_version = \"huggingface-textgeneration1-gpt-j-6b\", \"1.*\""
]
},
{
Expand Down Expand Up @@ -317,24 +318,24 @@
"---\n",
"```\n",
"This report includes estimates, projections, statements relating to our\n",
"business plans, objectives, and expected operating results that are \u201cforward-\n",
"looking statements\u201d within the meaning of the Private Securities Litigation\n",
"business plans, objectives, and expected operating results that are “forward-\n",
"looking statements within the meaning of the Private Securities Litigation\n",
"Reform Act of 1995, Section 27A of the Securities Act of 1933, and Section 21E\n",
"of the Securities Exchange Act of 1934. Forward-looking statements may appear\n",
"throughout this report, including the following sections: \u201cBusiness\u201d (Part I,\n",
"Item 1 of this Form 10-K), \u201cRisk Factors\u201d (Part I, Item 1A of this Form 10-K),\n",
"and \u201cManagement\u2019s Discussion and Analysis of Financial Condition and Results\n",
"of Operations\u201d (Part II, Item 7 of this Form 10-K). These forward-looking\n",
"statements generally are identified by the words \u201cbelieve,\u201d \u201cproject,\u201d\n",
"\u201cexpect,\u201d \u201canticipate,\u201d \u201cestimate,\u201d \u201cintend,\u201d \u201cstrategy,\u201d \u201cfuture,\u201d\n",
"\u201copportunity,\u201d \u201cplan,\u201d \u201cmay,\u201d \u201cshould,\u201d \u201cwill,\u201d \u201cwould,\u201d \u201cwill be,\u201d \u201cwill\n",
"continue,\u201d \u201cwill likely result,\u201d and similar expressions. Forward-looking\n",
"throughout this report, including the following sections: “Business” (Part I,\n",
"Item 1 of this Form 10-K), “Risk Factors (Part I, Item 1A of this Form 10-K),\n",
"and “Management’s Discussion and Analysis of Financial Condition and Results\n",
"of Operations (Part II, Item 7 of this Form 10-K). These forward-looking\n",
"statements generally are identified by the words “believe,” “project,”\n",
"“expect,” “anticipate,” “estimate,” “intend,” “strategy,” “future,”\n",
"“opportunity,” “plan,” “may,” “should,” “will,” “would,” “will be,” “will\n",
"continue,” “will likely result, and similar expressions. Forward-looking\n",
"statements are based on current expectations and assumptions that are subject\n",
"to risks and uncertainties that may cause actual results to differ materially.\n",
"We describe risks and uncertainties that could cause actual results and events\n",
"to differ materially in \u201cRisk Factors,\u201d \u201cManagement\u2019s Discussion and Analysis\n",
"of Financial Condition and Results of Operations,\u201d and \u201cQuantitative and\n",
"Qualitative Disclosures about Market Risk\u201d (Part II, Item 7A of this Form\n",
"to differ materially in “Risk Factors,” “Management’s Discussion and Analysis\n",
"of Financial Condition and Results of Operations, and “Quantitative and\n",
"Qualitative Disclosures about Market Risk (Part II, Item 7A of this Form\n",
"10-K). Readers are cautioned not to place undue reliance on forward-looking\n",
"statements, which speak only as of the date they are made. We undertake no\n",
"obligation to update or revise publicly any forward-looking statements,\n",
Expand Down Expand Up @@ -762,6 +763,7 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "5eb59a9c",
"metadata": {},
"source": [
"## Notebook CI Test Results\n",
Expand Down Expand Up @@ -821,4 +823,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"from sagemaker.jumpstart.model import JumpStartModel\n",
"\n",
"# Replace with larger model if needed\n",
"model_id, model_version = \"huggingface-text2text-flan-t5-base\", \"*\"\n",
"model_id, model_version = \"huggingface-text2text-flan-t5-base\", \"1.*\"\n",
"pretrained_model = JumpStartModel(model_id=model_id)\n",
"pretrained_predictor = pretrained_model.deploy()"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"source": [
"from sagemaker.jumpstart.model import JumpStartModel\n",
"\n",
"model = JumpStartModel(model_id=model_id)\n",
"model = JumpStartModel(model_id=model_id, model_version=model_version)\n",
"predictor = model.deploy()"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
},
"outputs": [],
"source": [
"model_id, model_version = \"meta-textgeneration-llama-2-7b\", \"*\""
"model_id, model_version = \"meta-textgeneration-llama-2-7b\", \"2.*\""
]
},
{
Expand All @@ -133,7 +133,7 @@
"source": [
"from sagemaker.jumpstart.model import JumpStartModel\n",
"\n",
"pretrained_model = JumpStartModel(model_id=model_id)\n",
"pretrained_model = JumpStartModel(model_id=model_id, model_version=model_version)\n",
"pretrained_predictor = pretrained_model.deploy()"
]
},
Expand Down Expand Up @@ -358,6 +358,7 @@
"\n",
"estimator = JumpStartEstimator(\n",
" model_id=model_id,\n",
" model_version=model_version,\n",
" environment={\"accept_eula\": \"true\"},\n",
" disable_output_compression=True, # For Llama-2-70b, add instance_type = \"ml.g5.48xlarge\"\n",
")\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,9 @@
},
"outputs": [],
"source": [
"(\n",
" model_id,\n",
" model_version,\n",
") = (\n",
"(model_id, model_version,) = (\n",
" \"meta-textgeneration-llama-2-7b\",\n",
" \"*\",\n",
" \"2.*\",\n",
")"
]
},
Expand All @@ -116,7 +113,7 @@
"source": [
"from sagemaker.jumpstart.model import JumpStartModel\n",
"\n",
"model = JumpStartModel(model_id=model_id)\n",
"model = JumpStartModel(model_id=model_id, model_version=model_version)\n",
"predictor = model.deploy()"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"aws_role = sagemaker_session.get_caller_identity_arn()\n",
"aws_region = boto3.Session().region_name\n",
"sess = sagemaker.Session()\n",
"model_version = \"*\""
"model_version = \"1.*\""
]
},
{
Expand Down Expand Up @@ -327,7 +327,7 @@
"metadata": {},
"outputs": [],
"source": [
"model_id, model_version = \"huggingface-textembedding-gpt-j-6b\", \"*\"\n",
"model_id, model_version = \"huggingface-textembedding-gpt-j-6b\", \"1.*\"\n",
"\n",
"endpoint_name_embed = name_from_base(f\"jumpstart-example-ragknn-{model_id}\")\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"aws_role = sagemaker_session.get_caller_identity_arn()\n",
"aws_region = boto3.Session().region_name\n",
"sess = sagemaker.Session()\n",
"model_version = \"*\""
"model_version = \"1.*\""
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@
"from sagemaker.predictor import Predictor\n",
"\n",
"\n",
"model = JumpStartModel(model_id=model_config.model_id, **model_config.model_kwargs)\n",
"model = JumpStartModel(\n",
" model_id=model_config.model_id, model_version=\"1.*\", **model_config.model_kwargs\n",
")\n",
"predictor = model.deploy()"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
"source": [
"model_id, model_version, = (\n",
" \"huggingface-textgeneration1-gpt-j-6b\",\n",
" \"*\",\n",
" \"1.*\",\n",
")"
]
},
Expand Down Expand Up @@ -239,7 +239,7 @@
"outputs": [],
"source": [
"# model_version=\"*\" fetches the latest version of the model\n",
"model_id, model_version = model_dropdown.value, \"*\""
"model_id, model_version = model_dropdown.value, \"1.*\""
]
},
{
Expand Down Expand Up @@ -524,7 +524,7 @@
" \"\"\"[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",
" [Summary]: Amazon and University researchers make fact extraction and verification dataset publicly available.\n",
" ###\n",
" [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",
" [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",
" [Summary]: Prime members in the U.S. can enjoy one year of Grubhub+ for free, with no food-delivery fees on eligible orders.\n",
" ###\n",
" [Original]: {text}\n",
Expand Down Expand Up @@ -695,7 +695,7 @@
},
"outputs": [],
"source": [
"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.\""
"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.\""
]
},
{
Expand Down Expand Up @@ -1179,13 +1179,13 @@
"outputs": [],
"source": [
"prompts = [\n",
" \"\"\"Hugging Face a r\u00e9volutionn\u00e9 le NLP.\n",
" \"\"\"Hugging Face a révolutionné le NLP.\n",
" Translation: Hugging Face revolutionized NLP.\n",
" ###\n",
" Cela est incroyable!\n",
" Translation: This is unbelievable!\n",
" ###\n",
" D\u00e9sol\u00e9 je ne peux pas.\n",
" Désolé je ne peux pas.\n",
" Translation: Sorry but I cannot.\n",
" ###\n",
" {sentence}\n",
Expand Down Expand Up @@ -1921,4 +1921,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
},
"outputs": [],
"source": [
"model_id, model_version, = (\n",
"model_id, model_version = (\n",
" \"huggingface-textgeneration-open-llama\",\n",
" \"*\",\n",
" \"2.*\",\n",
")"
]
},
Expand All @@ -61,7 +61,7 @@
"from sagemaker.jumpstart.model import JumpStartModel\n",
"from sagemaker.serializers import JSONSerializer\n",
"\n",
"my_model = JumpStartModel(model_id=model_id)\n",
"my_model = JumpStartModel(model_id=model_id, model_version=model_version)\n",
"predictor = my_model.deploy()\n",
"\n",
"predictor.serializer = JSONSerializer()\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
"outputs": [],
"source": [
"model_id = \"huggingface-text2text-flan-t5-large\"\n",
"model_version = \"*\""
"model_version = \"1.*\""
]
},
{
Expand Down Expand Up @@ -224,7 +224,7 @@
"outputs": [],
"source": [
"# model_version=\"*\" fetches the latest version of the model\n",
"model_id, model_version = model_dropdown.value, \"*\""
"model_id, model_version = model_dropdown.value, \"1.*\""
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "71a7d870",
"metadata": {},
"source": [
"---\n",
Expand Down Expand Up @@ -162,7 +163,7 @@
"source": [
"model_id, model_version, = (\n",
" \"huggingface-textgeneration1-bloomz-7b1-fp16\",\n",
" \"*\",\n",
" \"1.*\",\n",
")"
]
},
Expand Down Expand Up @@ -232,7 +233,7 @@
"outputs": [],
"source": [
"# model_version=\"*\" fetches the latest version of the model\n",
"model_id, model_version = model_dropdown.value, \"*\""
"model_id, model_version = model_dropdown.value, \"1.*\""
]
},
{
Expand Down Expand Up @@ -540,7 +541,7 @@
"metadata": {},
"outputs": [],
"source": [
"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\"\"\""
"text = \"\"\"一个传奇的开端,一个不灭的神话,这不仅仅是一部电影,而是作为一个走进新时代的标签,永远彪炳史册。\"\"\""
]
},
{
Expand Down Expand Up @@ -697,7 +698,7 @@
"source": [
"sentence = \"\"\"Amazon Web Services (AWS) has announced nine major new updates for its cloud-based machine learning platform, SageMaker.\n",
"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",
"During this year\u2019s re:Invent conference, AWS made several announcements to further improve SageMaker\u2019s capabilities.\"\"\""
"During this year’s re:Invent conference, AWS made several announcements to further improve SageMaker’s capabilities.\"\"\""
]
},
{
Expand Down Expand Up @@ -883,9 +884,9 @@
"source": [
"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",
"\n",
"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",
"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",
"\n",
"Here\u2019s everything you need to know about the Kindle Scribe, including frequently asked questions.\n",
"Here’s everything you need to know about the Kindle Scribe, including frequently asked questions.\n",
"\n",
"The Kindle Scribe makes it easy to read and write like you would on paper \n",
"\n",
Expand Down Expand Up @@ -1183,9 +1184,9 @@
"source": [
"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",
"\n",
"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",
"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",
"\n",
"Here\u2019s everything you need to know about the Kindle Scribe, including frequently asked questions.\n",
"Here’s everything you need to know about the Kindle Scribe, including frequently asked questions.\n",
"\n",
"The Kindle Scribe makes it easy to read and write like you would on paper \n",
"\n",
Expand Down Expand Up @@ -1248,6 +1249,7 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "3c8760a6",
"metadata": {},
"source": [
"## Notebook CI Test Results\n",
Expand Down Expand Up @@ -1796,4 +1798,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"source": [
"model_id, model_version = (\n",
" \"huggingface-text2text-flan-t5-xl\",\n",
" \"*\",\n",
" \"1.*\",\n",
")"
]
},
Expand Down Expand Up @@ -227,7 +227,7 @@
"outputs": [],
"source": [
"# model_version=\"*\" fetches the latest version of the model\n",
"model_id, model_version = model_dropdown.value, \"*\""
"model_id, model_version = model_dropdown.value, \"1.*\""
]
},
{
Expand Down
Loading