Skip to content

Commit

Permalink
Add ability to specify the OpenAI model & version to deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
edeandrea committed Nov 16, 2023
1 parent 7f25277 commit 981f8ac
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions scripts/create-azure-openai-resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ help() {
echo " -h Prints this help message"
echo " -l <location> The location (region) to deploy resources into"
echo " Default: 'eastus'"
echo " -m <model> The model to use"
echo " Default: 'gpt-35-turbo'"
echo " -t <tag> The tag to use when creating resources"
echo " Default: 'super-heroes'"
echo " -u <unique_identifier> A unique identifier to append to some resources. Some Azure services require unique names within a region (across users)."
echo " Default is to use the output of the 'whoami' command."
echo " -v <model_version> The model version to use"
echo " Default: '0301'"
}

exit_abnormal() {
Expand All @@ -38,10 +42,12 @@ COGNITIVE_DEPLOYMENT="csdeploy-super-heroes"
RESOURCE_GROUP="rg-super-heroes"
LOCATION="eastus"
TAG="super-heroes"
MODEL="gpt-35-turbo"
MODEL_VERSION="0301"
UNIQUE_IDENTIFIER=$(whoami)

# Process the input options
while getopts "c:d:g:hl:t:u:" option; do
while getopts "c:d:g:hm:l:t:u:v:" option; do
case $option in
c) COGNITIVE_SERVICE=$OPTARG
;;
Expand All @@ -59,6 +65,12 @@ while getopts "c:d:g:hl:t:u:" option; do
l) LOCATION=$OPTARG
;;

m) MODEL=$OPTARG
;;

v) MODEL_VERSION=$OPTARG
;;

t) TAG=$OPTARG
;;

Expand All @@ -76,6 +88,8 @@ echo " Cognitive Service Name: $COGNITIVE_SERVICE"
echo " Cognitive Service Deployment: $COGNITIVE_DEPLOYMENT"
echo " Resource Group: $RESOURCE_GROUP"
echo " Location: $LOCATION"
echo " Model: $MODEL"
echo " Model Version: $MODEL_VERSION"
echo " Tag: $TAG"
echo " Unique Identifier: $UNIQUE_IDENTIFIER"
echo
Expand Down Expand Up @@ -116,8 +130,8 @@ az cognitiveservices account deployment create \
--name "$COGNITIVE_SERVICE" \
--resource-group "$RESOURCE_GROUP" \
--deployment-name "$COGNITIVE_DEPLOYMENT" \
--model-name gpt-35-turbo \
--model-version 0301 \
--model-name "$MODEL"turbo \
--model-version "$MODEL_VERSION" \
--model-format OpenAI \
--sku-name Standard \
--sku-capacity 1
Expand Down

0 comments on commit 981f8ac

Please sign in to comment.