Additional resources and tips

This commit is contained in:
Edward Donner
2025-02-15 08:31:06 -05:00
parent 289a1b9bd1
commit ec4ada6456
14 changed files with 133 additions and 81 deletions

View File

@@ -36,7 +36,8 @@
"## I am here to help\n",
"\n",
"If you have any problems at all, please do reach out. \n",
"I'm available through the platform, or at ed@edwarddonner.com, or at https://www.linkedin.com/in/eddonner/ if you'd like to connect (and I love connecting!)\n",
"I'm available through the platform, or at ed@edwarddonner.com, or at https://www.linkedin.com/in/eddonner/ if you'd like to connect (and I love connecting!) \n",
"And this is new to me, but I'm also trying out X/Twitter at [@edwarddonner](https://x.com/edwarddonner) - if you're on X, please show me how it's done 😂 \n",
"\n",
"## More troubleshooting\n",
"\n",
@@ -53,7 +54,19 @@
" </td>\n",
" <td>\n",
" <h2 style=\"color:#900;\">Please read - important note</h2>\n",
" <span style=\"color:#900;\">The way I collaborate with you may be different to other courses you've taken. I prefer not to type code while you watch. Rather, I execute Jupyter Labs, like this, and give you an intuition for what's going on. My suggestion is that you do this with me, either at the same time, or (perhaps better) right afterwards. Add print statements to understand what's going on, and then come up with your own variations. If you have a Github account, use this to showcase your variations. Not only is this essential practice, but it demonstrates your skills to others, including perhaps future clients or employers...</span>\n",
" <span style=\"color:#900;\">The way I collaborate with you may be different to other courses you've taken. I prefer not to type code while you watch. Rather, I execute Jupyter Labs, like this, and give you an intuition for what's going on. My suggestion is that you carefully execute this yourself, <b>after</b> watching the lecture. Add print statements to understand what's going on, and then come up with your own variations. If you have a Github account, use this to showcase your variations. Not only is this essential practice, but it demonstrates your skills to others, including perhaps future clients or employers...</span>\n",
" </td>\n",
" </tr>\n",
"</table>\n",
"<table style=\"margin: 0; text-align: left;\">\n",
" <tr>\n",
" <td style=\"width: 150px; height: 150px; vertical-align: middle;\">\n",
" <img src=\"../resources.jpg\" width=\"150\" height=\"150\" style=\"display: block;\" />\n",
" </td>\n",
" <td>\n",
" <h2 style=\"color:#f71;\">Treat these labs as a resource</h2>\n",
" <span style=\"color:#f71;\">I push updates to the code regularly. When people ask questions or have problems, I incorporate it in the code, adding more examples or improved commentary. As a result, you'll notice that the code below isn't identical to the videos. Everything from the videos is here; but in addition, I've added more steps and better explanations. Consider these labs like an interactive book that accompany the lectures.\n",
" </span>\n",
" </td>\n",
" </tr>\n",
"</table>\n",
@@ -146,6 +159,21 @@
"# If it STILL doesn't work (horrors!) then please see the Troubleshooting notebook in this folder for full instructions"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "36647a1c-9970-4486-81e0-7c41e81e18cf",
"metadata": {},
"outputs": [],
"source": [
"api_key = \"sk-proj-3gfz2-gil9zs21dE-xMJQXQ5pp_Kciz9Almshfes53gu76b5R2k1Dd7o8H_53xeDPKcfxSr6X4T3BlbkFJx\"\n",
"api_key += \"o7n3Cgwb04tLnlGz2NMtT9H4TZQ4Jjm8XUJQxBdZ7sqjR7hm3fJ5KSX0r45jnzJR3jUROSBDwRMA\"\n",
"openai = OpenAI(api_key=api_key)\n",
"message = \"Hello, GPT! This is my first ever message to you! Hi!\"\n",
"response = openai.chat.completions.create(model=\"gpt-4o-mini\", messages=[{\"role\":\"user\", \"content\":message}])\n",
"print(response.choices[0].message.content)"
]
},
{
"cell_type": "markdown",
"id": "442fc84b-0815-4f40-99ab-d9a5da6bda91",
@@ -541,6 +569,14 @@
"Here are good instructions courtesy of an AI friend: \n",
"https://chatgpt.com/share/677a9cb5-c64c-8012-99e0-e06e88afd293"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f4484fcf-8b39-4c3f-9674-37970ed71988",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {

View File

@@ -411,7 +411,7 @@
"\n",
"This is perhaps the first example of Agentic AI design patterns, as we combined multiple calls to LLMs. This will feature more in Week 2, and then we will return to Agentic AI in a big way in Week 8 when we build a fully autonomous Agent solution.\n",
"\n",
"Generating content in this way is one of the very most common Use Cases. As with summarization, this can be applied to any business vertical. Write marketing content, generate a product tutorial from a spec, create personalized email content, and so much more. Explore how you can apply content generation to your business, and try making yourself a proof-of-concept prototype.</span>\n",
"Generating content in this way is one of the very most common Use Cases. As with summarization, this can be applied to any business vertical. Write marketing content, generate a product tutorial from a spec, create personalized email content, and so much more. Explore how you can apply content generation to your business, and try making yourself a proof-of-concept prototype. See what other students have done in the community-contributions folder -- so many valuable projects -- it's wild!</span>\n",
" </td>\n",
" </tr>\n",
"</table>"
@@ -446,9 +446,10 @@
" <img src=\"../resources.jpg\" width=\"150\" height=\"150\" style=\"display: block;\" />\n",
" </td>\n",
" <td>\n",
" <h2 style=\"color:#f71;\">A reminder on 2 useful resources</h2>\n",
" <h2 style=\"color:#f71;\">A reminder on 3 useful resources</h2>\n",
" <span style=\"color:#f71;\">1. The resources for the course are available <a href=\"https://edwarddonner.com/2024/11/13/llm-engineering-resources/\">here.</a><br/>\n",
" 2. I'm on LinkedIn <a href=\"https://www.linkedin.com/in/eddonner/\">here</a> and I love connecting with people taking the course!\n",
" 2. I'm on LinkedIn <a href=\"https://www.linkedin.com/in/eddonner/\">here</a> and I love connecting with people taking the course!<br/>\n",
" 3. I'm trying out X/Twitter and I'm at <a href=\"https://x.com/edwarddonner\">@edwarddonner<a> and hoping people will teach me how it's done.. \n",
" </span>\n",
" </td>\n",
" </tr>\n",

View File

@@ -113,6 +113,36 @@
" print(\"If in doubt, close down all jupyter lab, and follow Part 5 in the SETUP-PC or SETUP-mac guide.\")"
]
},
{
"cell_type": "markdown",
"id": "45e2cc99-b7d3-48bd-b27c-910206c4171a",
"metadata": {},
"source": [
"# Step 1.1\n",
"\n",
"## It's time to check that the environment is good and dependencies are installed\n",
"\n",
"And now, this next cell should run with no output - no import errors. \n",
"\n",
"Import errors might indicate that you started jupyter lab without your environment activated? See SETUP Part 5. \n",
"\n",
"Or you might need to restart your Kernel and Jupyter Lab. \n",
"\n",
"Or it's possible that something is wrong with Anaconda. \n",
"If so, here are some recovery instructions: \n",
"First, close everything down and restart your computer. \n",
"Then in an Anaconda Prompt (PC) or Terminal (Mac), from an activated environment, with **(llms)** showing in the prompt, from the llm_engineering directory, run this: \n",
"`python -m pip install --upgrade pip` \n",
"`pip install --retries 5 --timeout 15 --no-cache-dir --force-reinstall -r requirements.txt` \n",
"Watch carefully for any errors, and let me know. \n",
"If you see instructions to install Microsoft Build Tools, or Apple XCode tools, then follow the instructions. \n",
"Then try again!\n",
"\n",
"Finally, if that doesn't work, please try SETUP Part 2B, the alternative to Part 2 (with Python 3.11 or Python 3.12). \n",
"\n",
"If you're unsure, please run the diagnostics (last cell in this notebook) and then email me at ed@edwarddonner.com"
]
},
{
"cell_type": "code",
"execution_count": null,
@@ -120,11 +150,7 @@
"metadata": {},
"outputs": [],
"source": [
"# And now, this should run with no output - no import errors.\n",
"# Import errors might indicate that you started jupyter lab without your environment activated? See SETUP part 5.\n",
"# Or you might need to restart your Kernel and Jupyter Lab.\n",
"# Or it's possible that something is wrong with Anaconda. Please try SETUP Part 2B, the alternative to Part 2.\n",
"# If you're unsure, please run the diagnostics (last cell in this notebook) and then email me at ed@edwarddonner.com\n",
"# This import should work if your environment is active and dependencies are installed!\n",
"\n",
"from openai import OpenAI"
]
@@ -175,11 +201,14 @@
"\n",
" key_exists = any(line.startswith(\"OPENAI_API_KEY=\") for line in contents)\n",
" good_key = any(line.startswith(\"OPENAI_API_KEY=sk-proj-\") for line in contents)\n",
" classic_problem = any(\"OPEN_\" in line for line in contents)\n",
" \n",
" if key_exists and good_key:\n",
" print(\"SUCCESS! OPENAI_API_KEY found and it has the right prefix\")\n",
" elif key_exists:\n",
" print(\"Found an OPENAI_API_KEY although it didn't have the expected prefix sk-proj- \\nPlease double check your key in the file..\")\n",
" elif classic_problem:\n",
" print(\"Didn't find an OPENAI_API_KEY, but I notice that 'OPEN_' appears - do you have a typo like OPEN_API_KEY instead of OPENAI_API_KEY?\")\n",
" else:\n",
" print(\"Didn't find an OPENAI_API_KEY in the .env file\")\n",
"else:\n",
@@ -365,6 +394,11 @@
"It's unlikely, but if there's something wrong with your key, you could also try creating a new key (button on the top right) here: \n",
"https://platform.openai.com/api-keys\n",
"\n",
"### Check that you can use gpt-4o-mini from the OpenAI playground\n",
"\n",
"To confirm that billing is set up and your key is good, you could try using gtp-4o-mini directly: \n",
"https://platform.openai.com/playground/chat?models=gpt-4o-mini\n",
"\n",
"### If there's a cert related error\n",
"\n",
"If you encountered a certificates error like: \n",
@@ -380,7 +414,9 @@
"\n",
"(1) Try pasting your error into ChatGPT or Claude! It's amazing how often they can figure things out\n",
"\n",
"(2) Contact me! Please run the diagnostics in the cell below, then email me your problems to ed@edwarddonner.com\n",
"(2) Try creating another key and replacing it in the .env file and rerunning!\n",
"\n",
"(3) Contact me! Please run the diagnostics in the cell below, then email me your problems to ed@edwarddonner.com\n",
"\n",
"Thanks so much, and I'm sorry this is giving you bother!"
]