Skip to content

Commit 55e591d

Browse files
author
Zhi Zhou
committed
Address review comments
1 parent a295b30 commit 55e591d

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

Basic_Samples/GPT-4V/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ pip install -r requirements.txt
2323
```
2424

2525
### Microsoft Azure Endpoints
26-
In order to use REST API with Microsoft Azure endpoints, you need to set a series of configurations such as GPT-4V_MODEL, OPENAI_API_BASE, OPENAI_API_VERSION & VISION_API_ENDPOINT in _config.json_ file.
26+
In order to use REST API with Microsoft Azure endpoints, you need to set a series of configurations such as GPT-4V_DEPLOYMENT_NAME, OPENAI_API_BASE, OPENAI_API_VERSION in _config.json_ file.
2727

2828
```js
2929
{
30-
"GPT-4V_MODEL":"<GPT-4V Model Name>",
30+
"GPT-4V_DEPLOYMENT_NAME":"<GPT-4V Deployment Name>",
3131
"OPENAI_API_BASE":"https://<Your Azure Resource Name>.openai.azure.com",
3232
"OPENAI_API_VERSION":"<OpenAI API Version>",
3333

@@ -43,20 +43,22 @@ In order to use REST API with Microsoft Azure endpoints, you need to set a serie
4343
```
4444

4545
### For getting started:
46-
- Add "OPENAI_API_KEY" and "VISION_API_KEY" (optional) as variable name and \<Your API Key Value\> and \<Your VISION Key Value\> (optional) as variable value in the environment variables.
46+
- Add "OPENAI_API_KEY", "VISION_API_KEY", and "AZURE_SEARCH_QUERY_KEY" (optional) as variable name and \<Your API Key Value\>, \<Your VISION Key Value\>, and \<Your SEARCH Query Key Value\> (optional) as variable value in the environment variables.
4747
<br>
48-
One can get the OPENAI_API_KEY and VISION_API_KEY values from the Azure Portal. Go to https://portal.azure.com, find your resource and then under "Resource Management" -> "Keys and Endpoints" look for one of the "Keys" values.
48+
One can get the OPENAI_API_KEY, VISION_API_KEY, and AZURE_SEARCH_QUERY_KEY values from the Azure Portal. Go to https://portal.azure.com, find your resource and then under "Resource Management" -> "Keys and Endpoints" look for one of the "Keys" values.
4949
<br>
5050
5151
WINDOWS Users:
5252
setx OPENAI_API_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE"
5353
setx VISION_API_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE"
54+
setx AZURE_SEARCH_QUERY_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE"
5455

5556
MACOS/LINUX Users:
5657
export OPENAI_API_KEY="REPLACE_WITH_YOUR_KEY_VALUE_HERE"
5758
export VISION_API_KEY="REPLACE_WITH_YOUR_KEY_VALUE_HERE"
59+
export AZURE_SEARCH_QUERY_KEY="REPLACE_WITH_YOUR_KEY_VALUE_HERE"
5860

59-
- To find your "OPENAI_API_BASE" and "VISION_API_ENDPOINT" go to https://portal.azure.com, find your resource and then under "Resource Management" -> "Keys and Endpoints" look for the "Endpoint" value.
61+
- To find your "OPENAI_API_BASE", "VISION_API_ENDPOINT", and "AZURE_SEARCH_SERVICE_ENDPOINT" go to https://portal.azure.com, find your resource and then under "Resource Management" -> "Keys and Endpoints" look for the "Endpoint" value.
6062

6163
Learn more about Azure OpenAI Service REST API [here](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference).
6264

Basic_Samples/GPT-4V/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"GPT-4V_MODEL":"<GPT-4V Model Name>",
2+
"GPT-4V_DEPLOYMENT_NAME":"<GPT-4V Deployment Name>",
33
"OPENAI_API_BASE":"https://<Your Azure Resource Name>.openai.azure.com",
44
"OPENAI_API_VERSION":"<OpenAI API Version>",
55

Basic_Samples/GPT-4V/shared_functions.ipynb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
" config_details = json.load(config_file)\n",
4343
"\n",
4444
"# Setting up the deployment name\n",
45-
"deployment_name = config_details['GPT-4V_MODEL']\n",
45+
"deployment_name = config_details['GPT-4V_DEPLOYMENT_NAME']\n",
4646
"\n",
4747
"# The base URL for your Azure OpenAI resource. e.g. \"https://<your resource name>.openai.azure.com\"\n",
4848
"openai_api_base = config_details['OPENAI_API_BASE']\n",
@@ -239,6 +239,10 @@
239239
" print(state_data)\n",
240240
" print('Ingestion completed.')\n",
241241
" return True\n",
242+
" elif state_data['value'][0]['state'] == 'Failed':\n",
243+
" print(state_data)\n",
244+
" print(\"Ingestion failed.\")\n",
245+
" return False\n",
242246
" retries += 1\n",
243247
" return False\n",
244248
"\n",

0 commit comments

Comments
 (0)