For this workshop you MUST have the following:
- VsCode
- Python 3.7
- A virtual environment tool (venv)
- An Azure account
- An active Azure OpenAI account with 2 deployed models see below
- Create an Azure OpenAI account
- Create 'gpt-35-turbo','text-embedding-ada-002' deployments
- Install Visual Studio Code
- Install Python 3.7
-
Installation To install virtualenv via pip run: $ pip3 install virtualenv
-
Creation of virtualenv:
- Windows $ python -m virtualenv venv (in the openAI workshop directory)
- Mac $ virtualenv -p python3
Activate the virtualenv: $ source /bin/activate
Deactivate the virtualenv: $ deactivate
- Installation To install virtualenv via pip run: $ pip3 install virtualenv
- Creation of virtualenv:
- Windows $ python -m virtualenv venv (in the openAI workshop directory)
- Mac $ virtualenv -p python3
-
Activate the environment Windows: .\venv\Scripts\activate.ps1 Mac: $ source ./venv/bin/activate
-
Make sure you have the requirements installed in your Python environment using
pip install -r requirements.txt
.
-
Insert your subscription ID in the file createAll.ps1 and save it.
$SubscriptionId = "<your subscription here>"
-
Insert a name for your sql server in the file deployAll.bicep and save it
param serverName string = '<sql server name>'
-
This powershell script will create:
- A resourcegroup called openai-workshop
- An Azure SQL server called with an AdventureWorks DB
-
Go to the azure portal and login with a user that has administrator permissions
-
Upload the files in the scripts folder: "createAll.ps1" and "deployAll.bicep" ONE BY ONE by using the upload file button in the cloud shell
-
Run ./createAll.ps1 NOTE: This takes time so be patient You should get an Azure SQL server with a DB called aworks
- Rename the '.env.template' file to '.env' and modify all the endpoints and api keys for all openai deployments as follows:
OPENAI_DEPLOYMENT_ENDPOINT ="<your openai endpoint>"
OPENAI_API_KEY = "<your openai api key>"
OPENAI_DEPLOYMENT_NAME = "<your gpt35 deployment name>"
OPENAI_DEPLOYMENT_VERSION = "<gpt35 api version>"
OPENAI_MODEL_NAME="<gpt35 model name>"
OPENAI_ADA_EMBEDDING_DEPLOYMENT_NAME = "<your text embedding ada deployment name>"
OPENAI_ADA_EMBEDDING_MODEL_NAME = "<your text embedding ada model name>"
OPENAI_DAVINCI_EMBEDDING_DEPLOYMENT_NAME = "<your text embedding ada deployment name>"
OPENAI_DAVINCI_EMBEDDING_MODEL_NAME = "<your da vinci model name>"
SQL_SERVER="<your sql server>.database.windows.net"
SQL_USER="SqlAdmin"
SQL_PWD="ChangeYourAdminPassword1"
SQL_DBNAME="aworks"