Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleoconnell-NIH authored Jun 26, 2024
1 parent be05f76 commit 9ce95d1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 31 deletions.
23 changes: 8 additions & 15 deletions notebooks/GenAI/GCP_Grounding.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"id": "fbb045c4-b33f-4499-8d3d-c8545206e3ac",
"metadata": {},
"source": [
"Google Cloud's **Grounding** feature is designed to improve the accuracy and relevance of search results by understanding the context of your search query and the information presented on web pages or your own data via the console. This requires a search app and a data store which both will be created in another Google Cloud product called Agent Builder."
"Google Cloud's [Grounding](https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/overview) feature is designed to improve the accuracy and relevance of search results by understanding the context of your search query and the information presented on web pages or your own data via the console. This requires a search app and a data store which both will be created in another Google Cloud product called [Agent Builder\n",
"](https://cloud.google.com/products/agent-builder?hl=en)."
]
},
{
Expand Down Expand Up @@ -112,7 +113,7 @@
"id": "20abe50b-ebf4-4214-a494-b199ac7e56bb",
"metadata": {},
"source": [
"You have the option to tailor what kind of search you would like use for this tutorial we will be using **'Generic'**. The other two options include searching through media files and Healthcare file in FHIR format.\n",
"You have the option to tailor what kind of search you would like to use. For this tutorial we will be using **'Generic'**. The other two options include searching through media files and Healthcare files in FHIR format.\n",
"\n",
"Also make sure that you have enabled the **'Enterprise edition feature'** and **'Advance LLM feature'** to allow your app to be searchable via the grounding feature and if prompted set your location to **'global'**."
]
Expand Down Expand Up @@ -158,7 +159,7 @@
"id": "ccd0d718-eb6f-43b3-afe1-ec56d8108ef3",
"metadata": {},
"source": [
"As you can see from the image below Google Cloud's Agent builder support the following data sources but for this tutorial we will use **'Cloud Storage'** as our data source."
"As you can see from the image below Google Cloud's Agent builder supports the following data sources but for this tutorial we will use **'Cloud Storage'** as our data source."
]
},
{
Expand Down Expand Up @@ -335,7 +336,7 @@
"id": "87cdcc8a-6372-44fe-9f21-2c0e2428b045",
"metadata": {},
"source": [
"Now we can ask questions about our data and the model will only use our data store as the only source of information!"
"Now we can ask questions about our data and the model will use our data store as the only source of information!"
]
},
{
Expand Down Expand Up @@ -421,14 +422,6 @@
"source": [
"Please remember to delete or stop your **Jupyter notebook** and delete your **data store** and **search app** on Agent Builder to prevent incurring charges. And if you have created any other services like buckets, please remember to delete them as well."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2d8a9098-e645-4309-ac80-3e0944fc67b6",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -439,9 +432,9 @@
"uri": "gcr.io/deeplearning-platform-release/base-cpu:m114"
},
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python (Local)",
"language": "python",
"name": "python3"
"name": "base"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -453,7 +446,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.10.14"
}
},
"nbformat": 4,
Expand Down
24 changes: 8 additions & 16 deletions notebooks/GenAI/GCP_MedLM_Intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"metadata": {},
"source": [
"MedLM is a large language model developed by Google AI and is specifically designed for medical applications.\n",
"this model was trained on a massive dataset of medical text and code, including research papers, clinical notes, and medical textbooks. This allows it to understand and generate text related to medical concepts, diseases, treatments, and procedures."
"The model was trained on a massive dataset of medical text and code, including research papers, clinical notes, and medical textbooks. This allows it to understand and generate text related to medical concepts, diseases, treatments, and procedures."
]
},
{
Expand Down Expand Up @@ -103,8 +103,8 @@
"source": [
"Below we have created a function to invoke our MedLM model which will require a query as the only input. You can also configure the models output via the following variables:\n",
"\n",
"- **Max Output Tokens:** Limit of tokens outputted by the model.\n",
"- **Temperature:** Controls randomness, higher values increase diversity meaning a more unique response make the model to think harder. Must be a number from 0 to 1, 0 being less unique.\n",
"- **Max Output Tokens:** Limit of tokens output by the model.\n",
"- **Temperature:** Controls randomness, higher values increase diversity meaning a more unique response. Must be a number from 0 to 1, with 0 being less unique.\n",
"- **Top_p (nucleus):** The cumulative probability cutoff for token selection. Lower values mean sampling from a smaller, more top-weighted nucleus. Must be a number from 0 to 1.\n",
"- **Top_k:** Sample from the k most likely next tokens at each step. Lower k focuses on higher probability tokens. This means the model choses the most probable words. Lower values eliminate fewer coherent words."
]
Expand Down Expand Up @@ -167,7 +167,7 @@
},
"outputs": [],
"source": [
"query2 = 'What is the percentage of covid patients in VA?'"
"query2 = 'What is the monthly average of covid-19 patients in Virginia?'"
]
},
{
Expand Down Expand Up @@ -233,7 +233,7 @@
"metadata": {},
"outputs": [],
"source": [
"query = 'What is the percentage of covid patients in VA?'"
"query = 'What is the monthly average of covid-19 patients in Virginia?'"
]
},
{
Expand Down Expand Up @@ -358,14 +358,6 @@
"source": [
"Please remember to delete or stop your **Jupyter notebook** to prevent incurring charges! "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1730b237-df81-40ec-8acf-175b45d99f4c",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -376,9 +368,9 @@
"uri": "gcr.io/deeplearning-platform-release/base-cpu:m114"
},
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python (Local)",
"language": "python",
"name": "python3"
"name": "base"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -390,7 +382,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.10.14"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 9ce95d1

Please sign in to comment.