Skip to content

Commit

Permalink
point the link to main
Browse files Browse the repository at this point in the history
  • Loading branch information
lingyielia committed Aug 16, 2024
1 parent 953aef2 commit 25b40ca
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 80 deletions.
6 changes: 3 additions & 3 deletions vizro-ai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ It serves as an extension to Vizro, leveraging natural language capabilities to

## Try out live

| Platform | Chart creation |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Google Colab | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/mckinsey/vizro/blob/docs/add_colab_link/vizro-ai/examples/chart_by_vizro_ai.ipynb) |
| Platform | Chart creation |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Google Colab | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/mckinsey/vizro/blob/main/vizro-ai/examples/chart_by_vizro_ai.ipynb) |

## Why Vizro-AI?

Expand Down
153 changes: 76 additions & 77 deletions vizro-ai/examples/chart_by_vizro_ai.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,77 +7,25 @@
"id": "b72a43eb-2991-45da-844a-a88c1b9b6f1e"
},
"source": [
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/mckinsey/vizro/blob/docs/add_colab_link/vizro-ai/examples/chart_by_vizro_ai.ipynb)"
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/mckinsey/vizro/blob/main/vizro-ai/examples/chart_by_vizro_ai.ipynb)"
]
},
{
"cell_type": "code",
"source": [
"# @title\n",
"%%html\n",
"<style>\n",
" .cell-bg {\n",
" background-color: #E6F3FF;\n",
" padding: 10px;\n",
" width: 100%;\n",
" }\n",
" .disclaimer {\n",
" background-color: #ffffff;\n",
" border: 1px solid #ddd;\n",
" border-radius: 5px;\n",
" padding: 15px;\n",
" margin: 10px 0;\n",
" font-family: Arial, sans-serif;\n",
" }\n",
" .disclaimer h3 {\n",
" margin-top: 0;\n",
" }\n",
" .disclaimer ol {\n",
" padding-left: 20px;\n",
" }\n",
" .disclaimer li {\n",
" margin-bottom: 10px;\n",
" }\n",
" .disclaimer p {\n",
" font-weight: bold;\n",
" margin-bottom: 0;\n",
" }\n",
"</style>\n",
"\n",
"<div class=\"cell-bg\">\n",
" <div class=\"disclaimer\">\n",
" <h3>Disclaimer: Using Google Colab</h3>\n",
" <p>Please read carefully before proceeding:</p>\n",
" <ol>\n",
" <li><strong>Google's Servers:</strong> This notebook runs on Google's servers. Your code and data will be processed and temporarily stored on Google's infrastructure.</li>\n",
" <li><strong>Data Privacy:</strong> Be mindful of the data you upload or process here. Avoid using sensitive, confidential, or personal information that shouldn't be shared with third parties.</li>\n",
" <li><strong>Security Considerations:</strong> Colab is a shared environment. While Google implements security measures, treat it as a public environment and act accordingly.</li>\n",
" <li><strong>Terms of Service:</strong> Ensure your usage complies with Google Colab's Terms of Service and Google Cloud's Terms of Service.</li>\n",
" <li><strong>Data Persistence:</strong> Data in Colab notebooks is not permanently stored. Save important data and results to your local machine or a secure cloud storage.</li>\n",
" <li><strong>Resource Limitations:</strong> Colab provides free resources, but these are subject to availability and usage limits.</li>\n",
" </ol>\n",
" <p>By using this Colab notebook, you acknowledge that you understand and accept these conditions. Please use Colab at your own discretion and responsibility.</p>\n",
" </div>\n",
"</div>"
],
"execution_count": 12,
"id": "I6KPM-CnY_ag",
"metadata": {
"cellView": "form",
"id": "I6KPM-CnY_ag",
"outputId": "f138818d-28b4-47ea-b9c0-ed5c6c70eff5",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 352
}
},
"id": "I6KPM-CnY_ag",
"outputId": "f138818d-28b4-47ea-b9c0-ed5c6c70eff5"
},
"id": "I6KPM-CnY_ag",
"execution_count": 12,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"<style>\n",
" .cell-bg {\n",
Expand Down Expand Up @@ -123,24 +71,80 @@
" <p>By using this Colab notebook, you acknowledge that you understand and accept these conditions. Please use Colab at your own discretion and responsibility.</p>\n",
" </div>\n",
"</div>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {}
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# @title\n",
"%%html\n",
"<style>\n",
" .cell-bg {\n",
" background-color: #E6F3FF;\n",
" padding: 10px;\n",
" width: 100%;\n",
" }\n",
" .disclaimer {\n",
" background-color: #ffffff;\n",
" border: 1px solid #ddd;\n",
" border-radius: 5px;\n",
" padding: 15px;\n",
" margin: 10px 0;\n",
" font-family: Arial, sans-serif;\n",
" }\n",
" .disclaimer h3 {\n",
" margin-top: 0;\n",
" }\n",
" .disclaimer ol {\n",
" padding-left: 20px;\n",
" }\n",
" .disclaimer li {\n",
" margin-bottom: 10px;\n",
" }\n",
" .disclaimer p {\n",
" font-weight: bold;\n",
" margin-bottom: 0;\n",
" }\n",
"</style>\n",
"\n",
"<div class=\"cell-bg\">\n",
" <div class=\"disclaimer\">\n",
" <h3>Disclaimer: Using Google Colab</h3>\n",
" <p>Please read carefully before proceeding:</p>\n",
" <ol>\n",
" <li><strong>Google's Servers:</strong> This notebook runs on Google's servers. Your code and data will be processed and temporarily stored on Google's infrastructure.</li>\n",
" <li><strong>Data Privacy:</strong> Be mindful of the data you upload or process here. Avoid using sensitive, confidential, or personal information that shouldn't be shared with third parties.</li>\n",
" <li><strong>Security Considerations:</strong> Colab is a shared environment. While Google implements security measures, treat it as a public environment and act accordingly.</li>\n",
" <li><strong>Terms of Service:</strong> Ensure your usage complies with Google Colab's Terms of Service and Google Cloud's Terms of Service.</li>\n",
" <li><strong>Data Persistence:</strong> Data in Colab notebooks is not permanently stored. Save important data and results to your local machine or a secure cloud storage.</li>\n",
" <li><strong>Resource Limitations:</strong> Colab provides free resources, but these are subject to availability and usage limits.</li>\n",
" </ol>\n",
" <p>By using this Colab notebook, you acknowledge that you understand and accept these conditions. Please use Colab at your own discretion and responsibility.</p>\n",
" </div>\n",
"</div>"
]
},
{
"cell_type": "markdown",
"source": [
"#### Setup the LLM API key"
],
"id": "6Och8D7u0ovX",
"metadata": {
"id": "6Och8D7u0ovX"
},
"id": "6Och8D7u0ovX"
"source": [
"#### Setup the LLM API key"
]
},
{
"cell_type": "markdown",
"id": "FlndiROX0bmX",
"metadata": {
"id": "FlndiROX0bmX"
},
"source": [
"Secure your LLM API key as environment variable\n",
"- click the `Secrets` button on the left\n",
Expand All @@ -149,11 +153,7 @@
"- insert the API key value under `Value` (use raw string without quote. e.g., `xyz` instead of `\"xyz\"`)\n",
"- [optional] you might also need to insert \"OPENAI_BASE_URL\" and its value, based on the requirements from your API key provider (use raw string without quote. e.g., `xyz` instead of `\"xyz\"`)\n",
"- click the `Notebook access` toggle to make it available for the notebook run\n"
],
"metadata": {
"id": "FlndiROX0bmX"
},
"id": "FlndiROX0bmX"
]
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -181,7 +181,6 @@
"print(\"Installing dependencies\")\n",
"%pip install uv -q -q -q\n",
"!uv pip install --system \"vizro-ai @ git+https://github.com/mckinsey/vizro.git@main#subdirectory=vizro-ai\" --quiet\n",
"# %pip install \"vizro-ai @ git+https://github.com/mckinsey/vizro.git@main#subdirectory=vizro-ai\" -q -q -q\n",
"print(\"✅ Installation finished\")\n",
"\n",
"#@markdown #### 2. Setup LLM API access\n",
Expand Down Expand Up @@ -278,6 +277,13 @@
},
{
"cell_type": "code",
"execution_count": null,
"id": "O-LSNhSA7j3r",
"metadata": {
"cellView": "form",
"id": "O-LSNhSA7j3r"
},
"outputs": [],
"source": [
"# @title ## Create the chart using Vizro-AI\n",
"#@markdown Note: to iterate with different data, model, and prompt, please edit in cells above and click the corresponding `Run cell` buttons.\n",
Expand All @@ -295,14 +301,7 @@
"print(result.code)\n",
"print(\"\\n-------\\nFigure:\\n-------\\n\")\n",
"result.figure.show()"
],
"metadata": {
"cellView": "form",
"id": "O-LSNhSA7j3r"
},
"id": "O-LSNhSA7j3r",
"execution_count": null,
"outputs": []
]
}
],
"metadata": {
Expand Down

0 comments on commit 25b40ca

Please sign in to comment.