Skip to content

Commit

Permalink
Update for new models 4o
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffheaton committed Aug 9, 2024
1 parent d11634a commit b832f5a
Show file tree
Hide file tree
Showing 15 changed files with 1,402 additions and 1,405 deletions.
533 changes: 267 additions & 266 deletions t81_559_class_01_1_overview.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions t81_559_class_01_2_genai.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.18"
"version": "3.11.9"
},
"varInspector": {
"cols": {
Expand Down Expand Up @@ -217,5 +217,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
4 changes: 2 additions & 2 deletions t81_559_class_01_3_openai.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.10"
"version": "3.12.4"
},
"varInspector": {
"cols": {
Expand Down Expand Up @@ -351,5 +351,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
14 changes: 6 additions & 8 deletions t81_559_class_01_4_langchain.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@
}
],
"source": [
"MODEL = 'gpt-3.5-turbo'\n",
"#MODEL = 'gpt-4'\n",
"MODEL = 'gpt-4o-mini'\n",
"\n",
"# Initialize the OpenAI LLM with your API key\n",
"llm = ChatOpenAI(\n",
Expand Down Expand Up @@ -367,8 +366,7 @@
"\n",
"from langchain_openai import OpenAI, ChatOpenAI\n",
"\n",
"MODEL = 'gpt-3.5-turbo'\n",
"#MODEL = 'gpt-4'\n",
"MODEL = 'gpt-4o-mini'\n",
"\n",
"# Initialize the OpenAI LLM (Language Learning Model) with your API key\n",
"llm = ChatOpenAI(model=MODEL, temperature=0)\n",
Expand Down Expand Up @@ -494,7 +492,7 @@
},
"outputs": [],
"source": [
"MODEL = 'gpt-3.5-turbo'\n",
"MODEL = 'gpt-4o-mini'\n",
"\n",
"# Create a chain to generate a random\n",
"llm = ChatOpenAI(model=MODEL, temperature=0.7)\n",
Expand Down Expand Up @@ -701,7 +699,7 @@
"provenance": []
},
"kernelspec": {
"display_name": "Python 3.11 (genai)",
"display_name": "Python 3.11 (torch)",
"language": "python",
"name": "pytorch"
},
Expand All @@ -715,7 +713,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
},
"varInspector": {
"cols": {
Expand Down Expand Up @@ -748,5 +746,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
11 changes: 5 additions & 6 deletions t81_559_class_01_5_prompt_engineering.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,12 @@
" ),\n",
"]\n",
"\n",
"MODEL = 'gpt-3.5-turbo'\n",
"#MODEL = 'gpt-4'\n",
"MODEL = 'gpt-4o-mini'\n",
"\n",
"# Initialize the OpenAI LLM with your API key\n",
"llm = ChatOpenAI(\n",
" model=MODEL,\n",
" #model=\"gpt-4-turbo\",\n",
" #model=\"gpt-4o-mini\",\n",
" temperature= 0.0,\n",
" n= 1,\n",
" max_tokens= 256)\n",
Expand All @@ -291,7 +290,7 @@
"provenance": []
},
"kernelspec": {
"display_name": "Python 3.11 (genai)",
"display_name": "Python 3.11 (torch)",
"language": "python",
"name": "pytorch"
},
Expand All @@ -305,7 +304,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
},
"varInspector": {
"cols": {
Expand Down Expand Up @@ -338,5 +337,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
8 changes: 4 additions & 4 deletions t81_559_class_02_1_dev.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
"from langchain_openai import ChatOpenAI\n",
"from IPython.display import display_markdown\n",
"\n",
"MODEL = 'gpt-4-turbo'\n",
"MODEL = 'gpt-4o-mini'\n",
"\n",
"def generate_code(prompt):\n",
" messages = [\n",
Expand Down Expand Up @@ -635,7 +635,7 @@
"provenance": []
},
"kernelspec": {
"display_name": "Python 3.11 (genai)",
"display_name": "Python 3.11 (torch)",
"language": "python",
"name": "pytorch"
},
Expand All @@ -649,7 +649,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
},
"varInspector": {
"cols": {
Expand Down Expand Up @@ -682,5 +682,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
11 changes: 6 additions & 5 deletions t81_559_class_02_2_multi_prompt.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
{
"cell_type": "markdown",
"metadata": {
"id": "d4Yov72PhstY"
"id": "d4Yov72PhstY",
"jp-MarkdownHeadingCollapsed": true
},
"source": [
"# Module 2 Material\n",
Expand Down Expand Up @@ -207,7 +208,7 @@
"from langchain_core.prompts.chat import PromptTemplate\n",
"from IPython.display import display_markdown\n",
"\n",
"MODEL = 'gpt-4-turbo'\n",
"MODEL = 'gpt-4o-mini'\n",
"TEMPLATE = \"\"\"The following is a friendly conversation between a human and an\n",
"AI to generate Python code. If you have notes about the code, place them before\n",
"the code. Any nots about execution should follow the code. If you do mix any\n",
Expand Down Expand Up @@ -999,7 +1000,7 @@
"provenance": []
},
"kernelspec": {
"display_name": "Python 3.11 (genai)",
"display_name": "Python 3.11 (torch)",
"language": "python",
"name": "pytorch"
},
Expand All @@ -1013,7 +1014,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
},
"varInspector": {
"cols": {
Expand Down Expand Up @@ -1046,5 +1047,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
8 changes: 4 additions & 4 deletions t81_559_class_02_3_llm_debug.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"from langchain_core.prompts.chat import PromptTemplate\n",
"from IPython.display import display_markdown\n",
"\n",
"MODEL = 'gpt-4-turbo'\n",
"MODEL = 'gpt-4o-mini'\n",
"TEMPLATE = \"\"\"The following is a friendly conversation between a human and an\n",
"AI to generate Python code. If you have notes about the code, place them before\n",
"the code. Any nots about execution should follow the code. If you do mix any\n",
Expand Down Expand Up @@ -794,7 +794,7 @@
"provenance": []
},
"kernelspec": {
"display_name": "Python 3.11 (genai)",
"display_name": "Python 3.11 (torch)",
"language": "python",
"name": "pytorch"
},
Expand All @@ -808,7 +808,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
},
"varInspector": {
"cols": {
Expand Down Expand Up @@ -841,5 +841,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
8 changes: 4 additions & 4 deletions t81_559_class_02_4_software_eng.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
"from langchain_core.prompts.chat import PromptTemplate\n",
"from IPython.display import display_markdown\n",
"\n",
"MODEL = 'gpt-4-turbo'\n",
"MODEL = 'gpt-4o-mini'\n",
"TEMPLATE = \"\"\"The following is a friendly conversation between a human and an\n",
"AI to generate Python code. If you have notes about the code, place them before\n",
"the code. Any nots about execution should follow the code. If you do mix any\n",
Expand Down Expand Up @@ -595,7 +595,7 @@
"provenance": []
},
"kernelspec": {
"display_name": "Python 3.11 (genai)",
"display_name": "Python 3.11 (torch)",
"language": "python",
"name": "pytorch"
},
Expand All @@ -609,7 +609,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
},
"varInspector": {
"cols": {
Expand Down Expand Up @@ -642,5 +642,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
6 changes: 3 additions & 3 deletions t81_559_class_02_5_code_gen_limits.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@
"provenance": []
},
"kernelspec": {
"display_name": "Python 3.11 (genai)",
"display_name": "Python 3.11 (torch)",
"language": "python",
"name": "pytorch"
},
Expand All @@ -370,7 +370,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
},
"varInspector": {
"cols": {
Expand Down Expand Up @@ -403,5 +403,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
Loading

0 comments on commit b832f5a

Please sign in to comment.