Skip to content

Commit

Permalink
Merge pull request #590 from bmerkle/fix#589
Browse files Browse the repository at this point in the history
fix for issue#589
  • Loading branch information
koreyspace authored Sep 17, 2024
2 parents 3290089 + 3cc3003 commit b510fb8
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The following notebook was auto-generated by GitHub Copilot Chat and is meant for initial setup only"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -72,9 +65,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"That line is the opening lyric of \"The Star-Spangled Banner,\" the national anthem of the United States, written by Francis Scott Key. If you'd like more information or analysis, feel free to ask!\n"
]
}
],
"source": [
"import os\n",
"from azure.ai.inference import ChatCompletionsClient\n",
Expand Down Expand Up @@ -170,9 +171,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Jupiter is the fifth planet from the Sun and the biggest one in our Solar System. It's made of gas and is much bigger than all the other planets put together! You can see Jupiter in the night sky because it's very bright. People have noticed it for a really long time and named it after a Roman god.\n"
]
}
],
"source": [
"# Test Example\n",
"# https://platform.openai.com/playground/p/default-summarize\n",
Expand Down Expand Up @@ -217,9 +226,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Oh, you mean the famous 2020 World Series that wasn’t in a regular location? That was the year they played in the glamorous Arlington, Texas, at Globe Life Field.\n"
]
}
],
"source": [
"response = client.complete(\n",
" model=model_name,\n",
Expand Down Expand Up @@ -258,7 +275,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
30 changes: 19 additions & 11 deletions 06-text-generation-apps/python/githubmodels-assignment.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"\n",
"![GitHub Models GPT-4o Model Card](../images/GithubModels-modelcard.png?WT.mc_id=academic-105485-koreyst)\n",
"\n",
"But we will go straight to the playground by clicking the ['Playground' button, top right](https://github.com/marketplace/models/azure-openai/gpt-4o/playground?WT.mc_id=academic-105485-koreyst). You can interact with the model here, add system prompts and change parameter details - but also get all the code you need to run this from anywhere. Available as of August 2024: Python, Javascript and REST.\n",
"But we will go straight to the playground by clicking the ['Playground' button, top right](https://github.com/marketplace/models/azure-openai/gpt-4o/playground?WT.mc_id=academic-105485-koreyst). You can interact with the model here, add system prompts and change parameter details - but also get all the code you need to run this from anywhere. Available as of September 2024: Python, Javascript, C# and REST.\n",
"\n",
"![GitHub Models PLayground experience with code and languages shown](../images/GithubModels-plagroundcode.png?WT.mc_id=academic-105485-koreyst) \n",
"\n",
Expand All @@ -120,7 +120,7 @@
"\n",
"### 1.Codespaces \n",
"\n",
"* From the 'Get started' window choose Codespaces\n",
"* From the 'Get started' window choose \"Run codespace\"\n",
"* Create a new codespace (or use an existing)\n",
"* VS Code will open in your browser with a set of sample notebooks in multiple languages you can try\n",
"* Run the sample ```./githubmodels-app.py```. \n",
Expand All @@ -136,20 +136,21 @@
"* Select the language and SDK - in this example we choose Python and Azure AI Inference SDK\n",
"* Create a personal access token on GitHub. This sits in the Developer Settings section. You do not need to give any permissions to the token. Note that the token will be sent to a Microsoft service.\n",
"* Create an environment variable to store your Github personal access token - samples available in bash, powershell and windows command prompt\n",
"* Install dependencies: ```pip install azure-ai-inference```dotnetcli\n",
"* Install dependencies: ```pip install azure-ai-inference```\n",
"* Copy basic sample code into a .py file\n",
"* navigate to where your code is saved and run the file: ```python filename.py```dotnetcli\n",
"* navigate to where your code is saved and run the file: ```python filename.py```\n",
"\n",
"Don't forget by using the Azure AI Inference SDK, you can easily experiment with different models by modifying the value of `model_name` in the code. \n",
"\n",
"The following models are available in the GitHub Models service as of August 2024:\n",
"The following models are available in the GitHub Models service as of September 2024:\n",
"\n",
"* AI21 Labs: AI21-Jamba-Instruct\n",
"* Cohere: Cohere-command-r, Cohere-command-r-plus\n",
"* AI21 Labs: AI21-Jamba-1.5-Large, AI21-Jamba-1.5-Mini, AI21-Jamba-Instruct\n",
"* Cohere: Cohere-Command-R, Cohere-Command-R-Plus, Cohere-Embed-v3-Multilingual, Cohere-Embed-v3-English\n",
"* Meta: Meta-Llama-3-70B-Instruct, Meta-Llama-3-8B-Instruct, Meta-Llama-3.1-405B-Instruct, Meta-Llama-3.1-70B-Instruct, Meta-Llama-3.1-8B-Instruct\n",
"* Mistral AI: Mistral-large, Mistral-large-2407, Mistral-Nemo, Mistral-small\n",
"* Azure OpenAI: gpt-4o, gpt-4o-mini\n",
"* Microsoft: Phi-3-medium-128k-instruct, Phi-3-medium-4k-instruct, Phi-3-mini-128k-instruct, Phi-3-mini-4k-instruct, Phi-3-small-128k-instruct, Phi-3-small-8k-instruct\n",
"* Mistral AI: Mistral-Large, Mistral-Large-2407, Mistral-Nemo, Mistral-Small\n",
"* Microsoft: Phi-3-mini-4k-instruct, Phi-3.5-mini-128k-instruct, Phi-3-small-4k-instruct, Phi-3-small-128k-instruct, Phi-3-medium-4k-instruct, Phi-3-medium-128k-instruct, Phi-3.5-vision-128k-instruct\n",
"* OpenAI: OpenAI-GPT-4o, Open-AI-GPT-4o-mini, OpenAI-Textembedding-3-large, OpenAI-Textembedding-3-small\n",
"\n",
"\n",
"\n",
"**Now move to 'Generate Text' section below to continue this assignment**\n",
Expand Down Expand Up @@ -417,6 +418,13 @@
"print(response.choices[0].message.content)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -846,7 +854,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.11.9"
},
"orig_nbformat": 4
},
Expand Down

0 comments on commit b510fb8

Please sign in to comment.