Skip to content

Latest commit

 

History

History
 
 

0- Requirements

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

For this workshop you MUST have the following:

Requirements

  • VsCode
  • Python 3.7
  • A virtual environment tool (venv)
  • An Azure account
  • An active Azure OpenAI account with 2 deployed models see below

Preparation

OpenAI subscription and deployments

  • Create an Azure OpenAI account
  • Create 'gpt-35-turbo','text-embedding-ada-002' deployments

VsCode

Python

Python3 Virtualenv Setup

  • 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

Python3 Virtualenv Setup

  • 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

Install all libraries in your virtual environment

  • 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.

Create a sample Azure SQL DB with Adventureworks sample data

  • 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

  • Open the cloud shell in the azure portal as follows: Cloud shell

  • 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 Upload

  • Run ./createAll.ps1 Upload NOTE: This takes time so be patient You should get an Azure SQL server with a DB called aworks Upload

IMPORTANT!

Setup environment variables

  • 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"