Skip to content

Commit

Permalink
fix: Install errors on new python / DataSciv3
Browse files Browse the repository at this point in the history
Add '--no-build-isolation' to awscli install commands to work around
install error caused by yaml/pyyaml#601. Tested all notebooks on
Studio DataSci 3.0 kernel and updated kernel selection guidance.
  • Loading branch information
athewsey committed Aug 4, 2023
1 parent 3c12ea8 commit 4847ef9
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 70 deletions.
10 changes: 5 additions & 5 deletions 00_Intro/bedrock_boto3_setup.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# Amazon Bedrock boto3 Setup\n",
"\n",
"> *This notebook should work well with the **`Data Science 2.0`** kernel in SageMaker Studio*\n",
"> *This notebook should work well with the **`Data Science 3.0`** kernel in SageMaker Studio*\n",
"\n",
"---\n",
"\n",
Expand Down Expand Up @@ -38,7 +38,7 @@
"outputs": [],
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\n",
"%pip install --force-reinstall \\\n",
"%pip install --no-build-isolation --force-reinstall \\\n",
" ../dependencies/awscli-1.27.162-py3-none-any.whl \\\n",
" ../dependencies/boto3-1.26.162-py3-none-any.whl \\\n",
" ../dependencies/botocore-1.29.162-py3-none-any.whl"
Expand Down Expand Up @@ -1287,9 +1287,9 @@
],
"instance_type": "ml.t3.medium",
"kernelspec": {
"display_name": "Python 3 (Data Science 2.0)",
"display_name": "Python 3 (Data Science 3.0)",
"language": "python",
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/sagemaker-data-science-38"
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/sagemaker-data-science-310-v1"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -1301,7 +1301,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.10.6"
}
},
"nbformat": 4,
Expand Down
10 changes: 5 additions & 5 deletions 01_Generation/00_generate_w_bedrock.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"source": [
"# Invoke Bedrock model for text generation using zero-shot prompt\n",
"\n",
"> *This notebook should work well with the **`Data Science 2.0`** kernel in SageMaker Studio*"
"> *This notebook should work well with the **`Data Science 3.0`** kernel in SageMaker Studio*"
]
},
{
Expand Down Expand Up @@ -67,7 +67,7 @@
"outputs": [],
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\n",
"%pip install --force-reinstall \\\n",
"%pip install --no-build-isolation --force-reinstall \\\n",
" ../dependencies/awscli-1.27.162-py3-none-any.whl \\\n",
" ../dependencies/boto3-1.26.162-py3-none-any.whl \\\n",
" ../dependencies/botocore-1.29.162-py3-none-any.whl\n",
Expand Down Expand Up @@ -891,9 +891,9 @@
],
"instance_type": "ml.t3.medium",
"kernelspec": {
"display_name": "Python 3 (Data Science 2.0)",
"display_name": "Python 3 (Data Science 3.0)",
"language": "python",
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/sagemaker-data-science-38"
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/sagemaker-data-science-310-v1"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -905,7 +905,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.10.6"
}
},
"nbformat": 4,
Expand Down
14 changes: 8 additions & 6 deletions 01_Generation/01_zero_shot_generation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# Invoke Bedrock model using LangChain and a zero-shot prompt\n",
"\n",
"> *This notebook should work well with the **`Data Science 2.0`** kernel in SageMaker Studio*"
"> *This notebook should work well with the **`Data Science 3.0`** kernel in SageMaker Studio*"
]
},
{
Expand Down Expand Up @@ -59,11 +59,13 @@
"cell_type": "code",
"execution_count": null,
"id": "378c827b-802f-4e4c-8a4f-ab945d68e089",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\n",
"%pip install --force-reinstall \\\n",
"%pip install --no-build-isolation --force-reinstall \\\n",
" ../dependencies/awscli-1.27.162-py3-none-any.whl \\\n",
" ../dependencies/boto3-1.26.162-py3-none-any.whl \\\n",
" ../dependencies/botocore-1.29.162-py3-none-any.whl\n",
Expand Down Expand Up @@ -799,9 +801,9 @@
],
"instance_type": "ml.t3.medium",
"kernelspec": {
"display_name": "Python 3 (Data Science 2.0)",
"display_name": "Python 3 (Data Science 3.0)",
"language": "python",
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/sagemaker-data-science-38"
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/sagemaker-data-science-310-v1"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -813,7 +815,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.10.6"
}
},
"nbformat": 4,
Expand Down
17 changes: 9 additions & 8 deletions 01_Generation/02_contextual_generation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"source": [
"# Bedrock with LangChain using a Prompt that includes Context\n",
"\n",
"> *This notebook should work well with the **`Data Science 2.0`** kernel in SageMaker Studio*"
"> *This notebook should work well with the **`Data Science 3.0`** kernel in SageMaker Studio*"
]
},
{
Expand Down Expand Up @@ -73,7 +73,7 @@
"outputs": [],
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\n",
"%pip install --force-reinstall \\\n",
"%pip install --no-build-isolation --force-reinstall \\\n",
" ../dependencies/awscli-1.27.162-py3-none-any.whl \\\n",
" ../dependencies/boto3-1.26.162-py3-none-any.whl \\\n",
" ../dependencies/botocore-1.29.162-py3-none-any.whl\n",
Expand All @@ -85,7 +85,9 @@
"cell_type": "code",
"execution_count": null,
"id": "558a9372-0789-414a-a1d7-2976056f2015",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import json\n",
Expand Down Expand Up @@ -191,7 +193,6 @@
" template=\"\"\"Create an apology email from the Service Manager {customerServiceManager} to {customerName}. \n",
" in response to the following feedback that was received from the customer: {feedbackFromCustomer}.\n",
" \"\"\"\n",
" \n",
")\n",
"\n",
"# Pass in values to the input variables\n",
Expand Down Expand Up @@ -240,7 +241,7 @@
"source": [
"response = textgen_llm(prompt)\n",
"\n",
"email = response[response.index('\\n')+1:] \n",
"email = response[response.index('\\n')+1:]\n",
"\n",
"print_ww(email)"
]
Expand Down Expand Up @@ -834,9 +835,9 @@
],
"instance_type": "ml.t3.medium",
"kernelspec": {
"display_name": "Python 3 (Data Science 2.0)",
"display_name": "Python 3 (Data Science 3.0)",
"language": "python",
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/sagemaker-data-science-38"
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/sagemaker-data-science-310-v1"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -848,7 +849,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.10.6"
}
},
"nbformat": 4,
Expand Down
10 changes: 5 additions & 5 deletions 02_Summarization/01.small-text-summarization-claude.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# Text summarization with small files with Anthropic Claude\n",
"\n",
"> *This notebook should work well with the **`Data Science 2.0`** kernel in SageMaker Studio*"
"> *This notebook should work well with the **`Data Science 3.0`** kernel in SageMaker Studio*"
]
},
{
Expand Down Expand Up @@ -60,7 +60,7 @@
"outputs": [],
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\n",
"%pip install --force-reinstall \\\n",
"%pip install --no-build-isolation --force-reinstall \\\n",
" ../dependencies/awscli-1.27.162-py3-none-any.whl \\\n",
" ../dependencies/boto3-1.26.162-py3-none-any.whl \\\n",
" ../dependencies/botocore-1.29.162-py3-none-any.whl\n",
Expand Down Expand Up @@ -894,9 +894,9 @@
],
"instance_type": "ml.t3.medium",
"kernelspec": {
"display_name": "Python 3 (Data Science 2.0)",
"display_name": "Python 3 (Data Science 3.0)",
"language": "python",
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/sagemaker-data-science-38"
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/sagemaker-data-science-310-v1"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -908,7 +908,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.10.6"
}
},
"nbformat": 4,
Expand Down
10 changes: 5 additions & 5 deletions 02_Summarization/01.small-text-summarization-titan.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# Text summarization with small files with Amazon Titan\n",
"\n",
"> *This notebook should work well with the **`Data Science 2.0`** kernel in SageMaker Studio*"
"> *This notebook should work well with the **`Data Science 3.0`** kernel in SageMaker Studio*"
]
},
{
Expand Down Expand Up @@ -59,7 +59,7 @@
"outputs": [],
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\n",
"%pip install --force-reinstall \\\n",
"%pip install --no-build-isolation --force-reinstall \\\n",
" ../dependencies/awscli-1.27.162-py3-none-any.whl \\\n",
" ../dependencies/boto3-1.26.162-py3-none-any.whl \\\n",
" ../dependencies/botocore-1.29.162-py3-none-any.whl\n",
Expand Down Expand Up @@ -898,9 +898,9 @@
],
"instance_type": "ml.t3.medium",
"kernelspec": {
"display_name": "Python 3 (Data Science 2.0)",
"display_name": "Python 3 (Data Science 3.0)",
"language": "python",
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/sagemaker-data-science-38"
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/sagemaker-data-science-310-v1"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -912,7 +912,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.10.6"
}
},
"nbformat": 4,
Expand Down
10 changes: 5 additions & 5 deletions 02_Summarization/02.long-text-summarization-titan.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# Abstractive Text Summarization with Amazon Titan\n",
"\n",
"> *This notebook should work well with the **`Data Science 2.0`** kernel in SageMaker Studio*"
"> *This notebook should work well with the **`Data Science 3.0`** kernel in SageMaker Studio*"
]
},
{
Expand Down Expand Up @@ -60,7 +60,7 @@
"outputs": [],
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\n",
"%pip install --force-reinstall \\\n",
"%pip install --no-build-isolation --force-reinstall \\\n",
" ../dependencies/awscli-1.27.162-py3-none-any.whl \\\n",
" ../dependencies/boto3-1.26.162-py3-none-any.whl \\\n",
" ../dependencies/botocore-1.29.162-py3-none-any.whl\n",
Expand Down Expand Up @@ -865,9 +865,9 @@
],
"instance_type": "ml.t3.medium",
"kernelspec": {
"display_name": "Python 3 (Data Science 2.0)",
"display_name": "Python 3 (Data Science 3.0)",
"language": "python",
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/sagemaker-data-science-38"
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/sagemaker-data-science-310-v1"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -879,7 +879,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.10.6"
}
},
"nbformat": 4,
Expand Down
10 changes: 5 additions & 5 deletions 03_QuestionAnswering/00_qa_w_bedrock_titan.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"source": [
"# Question and answers with Bedrock\n",
"\n",
"> *This notebook should work well with the **`Data Science 2.0`** kernel in SageMaker Studio*\n",
"> *This notebook should work well with the **`Data Science 3.0`** kernel in SageMaker Studio*\n",
"\n",
"Question Answering (QA) is an important task that involves extracting answers to factual queries posed in natural language. Typically, a QA system processes a query against a knowledge base containing structured or unstructured data and generates a response with accurate information. Ensuring high accuracy is key to developing a useful, reliable and trustworthy question answering system, especially for enterprise use cases. \n",
"\n",
Expand Down Expand Up @@ -44,7 +44,7 @@
"outputs": [],
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\n",
"%pip install --force-reinstall \\\n",
"%pip install --no-build-isolation --force-reinstall \\\n",
" ../dependencies/awscli-1.27.162-py3-none-any.whl \\\n",
" ../dependencies/boto3-1.26.162-py3-none-any.whl \\\n",
" ../dependencies/botocore-1.29.162-py3-none-any.whl\n",
Expand Down Expand Up @@ -981,9 +981,9 @@
],
"instance_type": "ml.t3.medium",
"kernelspec": {
"display_name": "Python 3 (Data Science 2.0)",
"display_name": "Python 3 (Data Science 3.0)",
"language": "python",
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/sagemaker-data-science-38"
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/sagemaker-data-science-310-v1"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -995,7 +995,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.10.6"
}
},
"nbformat": 4,
Expand Down
10 changes: 5 additions & 5 deletions 03_QuestionAnswering/01_qa_w_rag_claude.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"source": [
"# Retrieval Augmented Question & Answering with Amazon Bedrock using LangChain\n",
"\n",
"> *This notebook should work well with the **`Data Science 2.0`** kernel in SageMaker Studio*"
"> *This notebook should work well with the **`Data Science 3.0`** kernel in SageMaker Studio*"
]
},
{
Expand Down Expand Up @@ -113,7 +113,7 @@
"outputs": [],
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\n",
"%pip install --force-reinstall \\\n",
"%pip install --no-build-isolation --force-reinstall \\\n",
" ../dependencies/awscli-1.27.162-py3-none-any.whl \\\n",
" ../dependencies/boto3-1.26.162-py3-none-any.whl \\\n",
" ../dependencies/botocore-1.29.162-py3-none-any.whl\n",
Expand Down Expand Up @@ -1084,9 +1084,9 @@
],
"instance_type": "ml.t3.medium",
"kernelspec": {
"display_name": "Python 3 (Data Science 2.0)",
"display_name": "Python 3 (Data Science 3.0)",
"language": "python",
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/sagemaker-data-science-38"
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:236514542706:image/sagemaker-data-science-310-v1"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -1098,7 +1098,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.10.6"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 4847ef9

Please sign in to comment.