Skip to content

Commit

Permalink
Fixed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
koreyspace committed Feb 22, 2024
1 parent d91b2af commit 97225eb
Show file tree
Hide file tree
Showing 38 changed files with 119 additions and 620 deletions.
51 changes: 27 additions & 24 deletions 00-course-setup/SETUP.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Setup Your Dev Environment

We have instrumented this repository with a _dev container_ that comes with a Python 3 runtime. Simply open the repo in GitHub Codespaces or on your local Docker Desktop, to activate the runtime automatically. Then open th Jupyter notebook and select the Python 3.x kernel to prepare the Notebook for execution.
We have setup this repository and course with a _dev container_ that comes with a Python 3 runtime. Open the repo in GitHub Codespaces or on your local Docker Desktop, to activate the runtime automatically. Then open th Jupyter notebook and select the Python 3.x kernel to prepare the Notebook for execution.

## 1. Create `.env` file

Expand All @@ -10,18 +10,20 @@ To configure this, we need to setup local environment variables for Azure as fol

1. Look in the root folder for a `.env.copy` file. It should contain a list of name-value pairs like this:

```bash
AZURE_OPENAI_ENDPOINT='<add your endpoint here>'
AZURE_OPENAI_DEPLOYMENT='<add your deployment name here>'
AZURE_OPENAI_KEY='<add your key here>'
AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT='<add your deployment name here>'
```
```bash
AZURE_OPENAI_ENDPOINT='<add your endpoint here>'
AZURE_OPENAI_DEPLOYMENT='<add your deployment name here>'
AZURE_OPENAI_KEY='<add your key here>'
AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT='<add your deployment name here>'
```

2. Make a copy of that file called `.env` using a command like this at the terminal:
```bash
cp .env.copy .env
```
This should create an identical copy _except that this file is .gitignore-d and will never get checked into source control_. We can now populate **this .env file** with the environment variable values (secrets) without fear of them being checked in accidentally. You can now move to the next section to start populating these variables.

```bash
cp .env.copy .env
```

This should create an identical copy _except that this file is .gitignore-d and will never get checked into source control_. We can now populate **this .env file** with the environment variable values (secrets) without fear of them being checked in accidentally. You can now move to the next section to start populating these variables.

3. (Option) If you use GitHub Codespaces, you have the option to save environment variables as _Codespaces secrets_ associated with this repository. In that case, you won't need to setup a local .env file. **However, note that this option works only if you use GitHub Codespaces.** You will still need to setup the .env file if you use Docker Desktop instead.

Expand All @@ -31,35 +33,35 @@ The above steps should be executed also if you are using the non-Azure OpenAI en
OPENAI_API_KEY='<add your OpenAI key here>'
```

## 2. Populate `.env` file

Let's take a quick look at the variable names to understand what they represent:

| Variable | Description |
|:---|:---|
|AZURE_OPENAI_ENDPOINT| This is the deployed endpoint for an Azure OpenAI resource|
|AZURE_OPENAI_KEY | This is the authorization key for using that service |
|OPENAI_API_KEY | This is the authorization key for using the service for non-Azure OpenAI endpoints |
|AZURE_OPENAI_DEPLOYMENT| This is the _text generation_ model deployment endpoint |
|AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT | This is the _text embeddings_ model deployment endpoint |
| | |
| Variable | Description |
| :--------------------------------- | :--------------------------------------------------------------------------------- |
| AZURE_OPENAI_ENDPOINT | This is the deployed endpoint for an Azure OpenAI resource |
| AZURE_OPENAI_KEY | This is the authorization key for using that service |
| OPENAI_API_KEY | This is the authorization key for using the service for non-Azure OpenAI endpoints |
| AZURE_OPENAI_DEPLOYMENT | This is the _text generation_ model deployment endpoint |
| AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT | This is the _text embeddings_ model deployment endpoint |
| | |

For context, the last two variables refer to specific models that are used in chat completion (text generation model) and vector search (embeddings model) activities that are frequently used in generative AI applications. In the following sections, we'll locate the _values_ for these variables and set them in `.env` (replacing the content within the `' '`, but preserving the quotes).

### 2.1 Use Azure Portal

The Azure OpenAI endpoint and key values will be found in the [Azure Portal](https://portal.azure.com?WT.mc_id=academic-105485-koreyst) so let's start there.

1. Navigate to the [Azure Portal](https://portal.azure.com?WT.mc_id=academic-105485-koreyst)
1. Go to the [Azure Portal](https://portal.azure.com?WT.mc_id=academic-105485-koreyst)
1. Click the **Keys and Endpoint** option in the sidebar (menu at left).
1. Click **Show Keys** - you should see the following: KEY 1, KEY 2 and Endpoint.
1. Use the KEY 1 value for AZURE_OPENAI_KEY
1. Use the Endpoint value for AZURE_OPENAI_ENDPOINT

Next, we need the endpoints for the specific models we've deployed.

1. Click the **Model deployments** option in the sidebar (left menu) for Azure OpenAI resource.
1. In the destination page, click **Manage Deployments**
1. In the destination page, click **Manage Deployments**

This will take you to the Azure OpenAI Studio website, where we'll find the other values as described below.

Expand All @@ -74,11 +76,12 @@ This will take you to the Azure OpenAI Studio website, where we'll find the othe
Now update the environment variables to reflect the _Deployment name_ used. This will typically be the same as the model name unless you changed it explcitly. So, as an example, you might have:

```bash
AZURE_OPENAI_DEPLOYMENT='gpt-35-turbo'
AZURE_OPENAI_DEPLOYMENT='gpt-35-turbo'
AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT='text-embedding-ada-002'
```

**Don't forget to save the .env file when done**. You can now exit the file and return to the instructions for running the notebook.

### 2.3 Use OpenAI Public API
Your OpenAI API key can be found in your [OpenAI account](https://platform.openai.com/api-keys?WT.mc_id=academic-105485-koreyst). If you don't have one, you can sign up for an account and create an API key. Once you have the key, you can use it to populate the `OPENAI_API_KEY` variable in the `.env` file.

Your OpenAI API key can be found in your [OpenAI account](https://platform.openai.com/api-keys?WT.mc_id=academic-105485-koreyst). If you don't have one, you can sign up for an account and create an API key. Once you have the key, you can use it to populate the `OPENAI_API_KEY` variable in the `.env` file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
135 changes: 0 additions & 135 deletions 13-continued-learning/README.md

This file was deleted.

Loading

0 comments on commit 97225eb

Please sign in to comment.