Skip to content

Commit 40b3400

Browse files
committed
restore embedding and chatgpt model parameters in bicep
1 parent dc74da4 commit 40b3400

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ For detailed instructions, see [Getting Started](#getting-started) below.
3939
* [Provision remaining resources](#provision-remaining-resources)
4040
* [Deploying again](#deploying-again)
4141
* [Running locally](#running-locally)
42-
* [To Run in GitHub Codespaces or VS Code Remote Containers](#to-run-in-github-codespaces-or-vs-code-remote-containers)
42+
* [To Run in GitHub Codespaces or VS Code Dev Containers](#to-run-in-github-codespaces-or-vs-code-dev-containers)
4343
* [UI Navigation](#ui-navigation)
4444
* [Enabling optional features](#enabling-optional-features)
4545
* [Enabling Application Insights](#enabling-application-insights)
@@ -76,12 +76,12 @@ User interface:
7676

7777
> **IMPORTANT:** In order to deploy and run this example, you'll need an **Azure subscription with access enabled for the Azure OpenAI Service**. You can request access [here](https://aka.ms/oaiapply). You can also visit [here](https://azure.microsoft.com/free/cognitive-search/) to get some free Azure credits to get you started.
7878
79-
### Run in GitHub Codespaces or VS Code Remote Containers
79+
### Run in GitHub Codespaces or VS Code Dev Containers
8080

81-
You can run this repo virtually by using GitHub Codespaces or VS Code Remote Containers. Click on one of the buttons below to open this repo in one of those options.
81+
You can run this repo virtually by using GitHub Codespaces or VS Code Dev Containers. Click on one of the buttons below to open this repo in one of those options.
8282

8383
[![Open in GitHub Codespaces](https://img.shields.io/static/v1?style=for-the-badge&label=GitHub+Codespaces&message=Open&color=brightgreen&logo=github)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=599293758&machine=standardLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=WestUs2)
84-
[![Open in VS Code Dev - Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Remote%20-%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/azure-samples/azure-search-openai-demo-java/)
84+
[![Open in VS Code Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Remote%20-%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/azure-samples/azure-search-openai-demo-java/)
8585

8686
All prerequisites are already installed in the container. You can skip to the [Starting from scratch](#starting-from-scratch) section.
8787

@@ -181,6 +181,13 @@ If you've changed the infrastructure files (`infra` folder or `azure.yaml`), the
181181
azd up
182182
```
183183
184+
### Examples of an azd deployment changing the default chatgpt deployment model
185+
```shell
186+
azd auth login
187+
azd env set AZURE_OPENAI_CHATGPT_MODEL "gpt-4" # Change the chatgpt model to gpt-4
188+
azd up
189+
```
190+
> NOTE: This sample has been tested with gpt-35-turbo/0613 model version.Using other models or different versions might result in unexpected behavior.
184191
### Examples of an azd deployment reusing an existing OpenAI and Azure Cognitive Search resources
185192
186193
```shell
@@ -472,7 +479,7 @@ Here are the most common failure scenarios and solutions:
472479
473480
7. After running `./app/start.ps1` or `./app/start.sh` you get `"Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project myproject: Fatal error compiling: invalid target release: 17"`. It means you are not using JDK 17 but a previous version. Be sure to set the `JAVA_HOME` env variable to your Java 17 installation directory and update your `PATH` env variable to have the Java 17 bin folder as the first occurrence amongst the listed directories. More info [here](https://learn.microsoft.com/en-us/java/openjdk/install)
474481
8. After running `./app/start.sh` on Ubuntu 16.04 or later, the first time you try to create a virtual environment with Python 3.6, Python 3.7, Python 3.8 or Python 3.9, you'll get the following error `"The virtual environment was not created successfully because ensurepip is not available"`. Just follow the hint provided in the error message and run `apt-get install python3-venv` to install the missing packages. More info [here](https://www.softwarepragmatism.com/cannot-create-a-python-virtual-environment-on-ubuntu-ensurepip-is-not-available)
475-
9. While running `azd up` in VS Code Remote Containers you got this error `".. Maven: failed finding mvnw in repository path: exec: /azure-search-openai-demo-java/app/backend/mvnw: permission denied "`. Run `chmod +x ./azure-search-openai-demo-javaapp/backend/mvnw` to fix it and rerun `azd up`.
482+
9. While running `azd up` in VS Code Dev Containers you got this error `".. Maven: failed finding mvnw in repository path: exec: /azure-search-openai-demo-java/app/backend/mvnw: permission denied "`. Run `chmod +x ./azure-search-openai-demo-javaapp/backend/mvnw` to fix it and rerun `azd up`.
476483
10. Github App CI pipeline might fail in some scenarios where the provisioned App Service instance doesn't have "Basic Auth Publishing Credentials" enabled in your subscription. To fix it, you can go to your App Service instance in Azure Portal, click on "Settings/Configuration(Panel)->General Settins (Tab)" and flag to ON the "Basic Auth Publishing Credentials" checkbox group. Or you can run the following azd cli commands:
477484
478485
```

infra/main.bicep

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ param formRecognizerSkuName string = 'S0'
5757

5858
param chatGptDeploymentName string // Set in main.parameters.json
5959
param chatGptDeploymentCapacity int = 30
60-
param chatGptModelName string = (openAiHost == 'azure') ? 'gpt-35-turbo' : 'gpt-3.5-turbo'
61-
param chatGptModelVersion string = '0613'
62-
param embeddingDeploymentName string = 'embedding'
60+
param chatGptModelName string // Set in main.parameters.json
61+
param chatGptModelVersion string
62+
param embeddingDeploymentName string // Set in main.parameters.json
6363
param embeddingDeploymentCapacity int = 30
6464
param embeddingModelName string = 'text-embedding-ada-002'
6565

infra/main.parameters.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,18 @@
5959
"storageSkuName": {
6060
"value": "${AZURE_STORAGE_SKU=Standard_LRS}"
6161
},
62+
"chatGptModelName": {
63+
"value": "${AZURE_OPENAI_CHATGPT_MODEL=gpt-35-turbo}"
64+
},
65+
"chatGptModelVersion": {
66+
"value": "${AZURE_OPENAI_CHATGPT_VERSION=0613}"
67+
},
6268
"chatGptDeploymentName": {
6369
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT=chat}"
6470
},
71+
"embeddingDeploymentName": {
72+
"value": "${AZURE_OPENAI_EMB_DEPLOYMENT=embedding}"
73+
},
6574
"openAiHost":{
6675
"value": "${OPENAI_HOST=azure}"
6776
},

0 commit comments

Comments
 (0)