Skip to content

Commit

Permalink
Merge aws-samples#23 new preview boto URL and version
Browse files Browse the repository at this point in the history
Remove hard-coding of preview library versions. Update preview SDK
download URL and ensure download script clears out old vers.

Co-authored-by: "Dan Straw" <[email protected]>
  • Loading branch information
athewsey and dastra authored Aug 8, 2023
2 parents 841141c + 4974544 commit 7e3c85b
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 43 deletions.
6 changes: 3 additions & 3 deletions 00_Intro/bedrock_boto3_setup.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\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"
" ../dependencies/awscli-*-py3-none-any.whl \\\n",
" ../dependencies/boto3-*-py3-none-any.whl \\\n",
" ../dependencies/botocore-*-py3-none-any.whl"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions 01_Generation/00_generate_w_bedrock.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\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",
" ../dependencies/awscli-*-py3-none-any.whl \\\n",
" ../dependencies/boto3-*-py3-none-any.whl \\\n",
" ../dependencies/botocore-*-py3-none-any.whl\n",
"\n",
"%pip install --quiet langchain==0.0.249"
]
Expand Down
6 changes: 3 additions & 3 deletions 01_Generation/01_zero_shot_generation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\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",
" ../dependencies/awscli-*-py3-none-any.whl \\\n",
" ../dependencies/boto3-*-py3-none-any.whl \\\n",
" ../dependencies/botocore-*-py3-none-any.whl\n",
"\n",
"%pip install --quiet langchain==0.0.249"
]
Expand Down
6 changes: 3 additions & 3 deletions 01_Generation/02_contextual_generation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\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",
" ../dependencies/awscli-*-py3-none-any.whl \\\n",
" ../dependencies/boto3-*-py3-none-any.whl \\\n",
" ../dependencies/botocore-*-py3-none-any.whl\n",
"\n",
"%pip install --quiet langchain==0.0.249 \"transformers>=4.24,<5\""
]
Expand Down
6 changes: 3 additions & 3 deletions 02_Summarization/01.small-text-summarization-claude.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\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",
" ../dependencies/awscli-*-py3-none-any.whl \\\n",
" ../dependencies/boto3-*-py3-none-any.whl \\\n",
" ../dependencies/botocore-*-py3-none-any.whl\n",
"\n",
"%pip install --quiet langchain==0.0.249"
]
Expand Down
6 changes: 3 additions & 3 deletions 02_Summarization/01.small-text-summarization-titan.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\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",
" ../dependencies/awscli-*-py3-none-any.whl \\\n",
" ../dependencies/boto3-*-py3-none-any.whl \\\n",
" ../dependencies/botocore-*-py3-none-any.whl\n",
"\n",
"%pip install --quiet langchain==0.0.249"
]
Expand Down
6 changes: 3 additions & 3 deletions 02_Summarization/02.long-text-summarization-titan.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\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",
" ../dependencies/awscli-*-py3-none-any.whl \\\n",
" ../dependencies/boto3-*-py3-none-any.whl \\\n",
" ../dependencies/botocore-*-py3-none-any.whl\n",
"\n",
"%pip install --quiet langchain==0.0.249 \"transformers>=4.24,<5\""
]
Expand Down
6 changes: 3 additions & 3 deletions 03_QuestionAnswering/00_qa_w_bedrock_titan.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\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",
" ../dependencies/awscli-*-py3-none-any.whl \\\n",
" ../dependencies/boto3-*-py3-none-any.whl \\\n",
" ../dependencies/botocore-*-py3-none-any.whl\n",
"\n",
"%pip install --quiet langchain==0.0.249"
]
Expand Down
6 changes: 3 additions & 3 deletions 03_QuestionAnswering/01_qa_w_rag_claude.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\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",
" ../dependencies/awscli-*-py3-none-any.whl \\\n",
" ../dependencies/boto3-*-py3-none-any.whl \\\n",
" ../dependencies/botocore-*-py3-none-any.whl\n",
"\n",
"%pip install --quiet \"faiss-cpu>=1.7,<2\" langchain==0.0.249 \"pypdf>=3.8,<4\""
]
Expand Down
6 changes: 3 additions & 3 deletions 04_Chatbot/00_Chatbot_AI21.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\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"
" ../dependencies/awscli-*-py3-none-any.whl \\\n",
" ../dependencies/boto3-*-py3-none-any.whl \\\n",
" ../dependencies/botocore-*-py3-none-any.whl"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions 04_Chatbot/00_Chatbot_Claude.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\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"
" ../dependencies/awscli-*-py3-none-any.whl \\\n",
" ../dependencies/boto3-*-py3-none-any.whl \\\n",
" ../dependencies/botocore-*-py3-none-any.whl"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions 04_Chatbot/00_Chatbot_Titan.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\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"
" ../dependencies/awscli-*-py3-none-any.whl \\\n",
" ../dependencies/boto3-*-py3-none-any.whl \\\n",
" ../dependencies/botocore-*-py3-none-any.whl"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions 05_Image/Bedrock Stable Diffusion XL.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
"source": [
"# Make sure you ran `download-dependencies.sh` from the root of the repository first!\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",
" ../dependencies/awscli-*-py3-none-any.whl \\\n",
" ../dependencies/boto3-*-py3-none-any.whl \\\n",
" ../dependencies/botocore-*-py3-none-any.whl\n",
"\n",
"%pip install --quiet \"pillow>=9.5,<10\""
]
Expand Down
11 changes: 7 additions & 4 deletions download-dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/bin/sh

echo "Creating directory"
mkdir -p ./dependencies && \
cd ./dependencies && \
set -e

echo "(Re)-creating directory"
rm -rf ./dependencies
mkdir ./dependencies
cd ./dependencies
echo "Downloading dependencies"
curl -sS https://preview.documentation.bedrock.aws.dev/Documentation/SDK/bedrock-python-sdk.zip > sdk.zip && \
curl -sS https://d2eo22ngex1n9g.cloudfront.net/Documentation/SDK/bedrock-python-sdk.zip > sdk.zip
echo "Unpacking dependencies"
# (SageMaker Studio system terminals don't have `unzip` utility installed)
if command -v unzip &> /dev/null
Expand Down

0 comments on commit 7e3c85b

Please sign in to comment.