Skip to content

Commit accf28f

Browse files
authored
Add Bedrock to Submodule 1 and README
1 parent 642b0e3 commit accf28f

2 files changed

Lines changed: 73 additions & 2 deletions

File tree

AWS/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,20 @@ Make sure that after you are done with the module, close the tab that appeared w
7979
- If you are unable to interact with your s3 bucket using the `aws s3` command, check your `nextflow-service-account` roles. Make sure that you have `Storage Admin` added.
8080
- If you are trying to execute a terminal command in a Jupyter code cell and it is not working, make sure that you have an `!` before the command.
8181
- e.g., `mkdir example-1` -> `!mkdir example-1`
82+
83+
## AWS Bedrock (Optional)
84+
85+
Generative AI is available for this tutorial if you would like to use it. To run it, please reference Submodule 1, or run the following code within a submodule notebook.
86+
87+
```!pip install -q ipywidgets
88+
import sys
89+
import os
90+
util_path = os.path.join(os.getcwd(), 'util')
91+
if util_path not in sys.path:
92+
sys.path.append(util_path)
93+
94+
# Import the display_widgets function from your Python file
95+
from genai import display_widgets
96+
97+
# Call the function to display the widgets
98+
display_widgets()

AWS/Submodule_1_background.ipynb

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@
4444
"\n",
4545
"6. **Introduce the AWS Batch API:** Learners are introduced to the AWS Batch API and its advantages for managing and executing workflows on cloud computing resources.\n",
4646
"\n",
47-
"7. **Familiarize learners with Jupyter Notebooks:** The notebook provides instructions on how to navigate and use Jupyter Notebooks, including cell types and execution order."
47+
"7. **Familiarize learners with Jupyter Notebooks:** The notebook provides instructions on how to navigate and use Jupyter Notebooks, including cell types and execution order.\n",
48+
"\n",
49+
"<div class=\"alert alert-block alert-success\">\n",
50+
" <i class=\"fa fa-hand-paper-o\" aria-hidden=\"true\"></i>\n",
51+
" <b>Tip: </b> If you're having trouble with any part of this tutorial, feel free to leverage AWS Bedrock (Amazon's advanced generative AI tool) at the bottom of this module.\n",
52+
"</div> "
4853
]
4954
},
5055
{
@@ -508,11 +513,60 @@
508513
"\n",
509514
"Remember to proceed to the next notebook [`Submodule_2_annotation_only.ipynb`](./Submodule_2_annotation_only.ipynb) or shut down your instance if you are finished."
510515
]
516+
},
517+
{
518+
"cell_type": "markdown",
519+
"id": "fc886b9b-518c-446d-a703-363b98e72db7",
520+
"metadata": {},
521+
"source": [
522+
"## Bedrock (Optional)\n",
523+
"--------\n",
524+
"\n",
525+
"If you're having trouble with this submodule (or others within this tutorial), feel free to leverage Bedrock by running the cell below. Bedrock is a fully managed service that simplifies building and scaling generative AI applications. It provides access to various foundation models (FMs) from Amazon and other AI companies.\n",
526+
"\n",
527+
"Before being able to use the chatbot you must request **Llama 3 8B Instruct** model access through AWS Bedrock. In order to do this follow the instructions to request model access provided in [AWS Bedrock Intro Notebook](https://github.com/STRIDES/NIHCloudLabAWS/blob/main/notebooks/GenAI/AWS_Bedrock_Intro.ipynb). After requesting the Llama 3 8B Instruct access it should only take a minute to get approved. While waiting for model approval, attach the **AmazonBedrockFullAccess** permission to your notebook service role. Once approved run the following code cell to use the model within the notebook. "
528+
]
529+
},
530+
{
531+
"cell_type": "code",
532+
"execution_count": null,
533+
"id": "2d9781c2-85b1-40de-a1f0-9cacaf5a7ff7",
534+
"metadata": {},
535+
"outputs": [],
536+
"source": [
537+
"# Ensure you have the necessary libraries installed\n",
538+
"!pip install -q ipywidgets\n",
539+
"import sys\n",
540+
"import os\n",
541+
"util_path = os.path.join(os.getcwd(), 'util')\n",
542+
"if util_path not in sys.path:\n",
543+
" sys.path.append(util_path)\n",
544+
"\n",
545+
"# Import the display_widgets function from your Python file\n",
546+
"from genai import display_widgets\n",
547+
"\n",
548+
"# Call the function to display the widgets\n",
549+
"display_widgets()"
550+
]
511551
}
512552
],
513553
"metadata": {
554+
"kernelspec": {
555+
"display_name": "conda_python3",
556+
"language": "python",
557+
"name": "conda_python3"
558+
},
514559
"language_info": {
515-
"name": "python"
560+
"codemirror_mode": {
561+
"name": "ipython",
562+
"version": 3
563+
},
564+
"file_extension": ".py",
565+
"mimetype": "text/x-python",
566+
"name": "python",
567+
"nbconvert_exporter": "python",
568+
"pygments_lexer": "ipython3",
569+
"version": "3.10.17"
516570
}
517571
},
518572
"nbformat": 4,

0 commit comments

Comments
 (0)