Skip to content

Commit 16e7553

Browse files
authored
Merge pull request #256506 from MicrosoftDocs/main
10/27/2023 PM Publish
2 parents 11f2133 + 0288c17 commit 16e7553

File tree

114 files changed

+1836
-1113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+1836
-1113
lines changed

articles/ai-services/computer-vision/how-to/video-retrieval.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,34 @@ Azure AI Spatial Analysis Video Retrieval APIs are part of Azure AI Vision and e
2525

2626
## Input requirements
2727

28-
### Supported file formats
28+
### Supported formats
29+
2930
| File format | Description |
3031
| ----------- | ----------- |
3132
| `asf` | ASF (Advanced / Active Streaming Format) |
33+
| `avi` | AVI (Audio Video Interleaved) |
3234
| `flv` | FLV (Flash Video) |
3335
| `matroskamm`, `webm` | Matroska / WebM |
34-
| `mov`, `mp4`, `m4a`, `3gp`, `3g2`, `mj2` | QuickTime / MOV |
35-
| `mpegts` | MPEG-TS (MPEG-2 Transport Stream) |
36-
| `rawvideo` | raw video |
37-
| `rm` | RealMedia |
38-
| `rtsp` | RTSP input |
36+
| `mov`,`mp4`,`m4a`,`3gp`,`3g2`,`mj2` | QuickTime / MOV |
37+
38+
### Supported video codecs
3939

40-
### Supported codecs
4140
| Codec | Format |
4241
| ----------- | ----------- |
4342
| `h264` | H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 |
44-
| `rawvideo` | raw video |
45-
| `h265` | HEVC
43+
| `h265` | H.265/HEVC |
4644
| `libvpx-vp9` | libvpx VP9 (codec vp9) |
45+
| `mpeg4` | MPEG-4 part 2 |
46+
47+
### Supported audio codecs
48+
49+
| Codec | Format |
50+
| ----------- | ----------- |
51+
| `aac` | AAC (Advanced Audio Coding) |
52+
| `mp3` | MP3 (MPEG audio layer 3) |
53+
| `pcm` | PCM (uncompressed) |
54+
| `vorbis` | Vorbis |
55+
| `wmav2` | Windows Media Audio 2 |
4756

4857
## Call the Video Retrieval APIs
4958

@@ -61,7 +70,7 @@ The Spatial Analysis Video Retrieval APIs allows a user to add metadata to video
6170

6271
### Step 1: Create an Index
6372

64-
To begin, you need to create an index to store and organize the video files and their metadata. The example below demonstrates how to create an index named "my-video-index."
73+
To begin, you need to create an index to store and organize the video files and their metadata. The example below demonstrates how to create an index named "my-video-index" using the **[Create Index](https://eastus.dev.cognitive.microsoft.com/docs/services/ingestion-api-private-preview-2023-05-01-preview/operations/645db36646346106fcc4779b)** API.
6574

6675
```bash
6776
curl.exe -v -X PUT "https://<YOUR_ENDPOINT_URL>/computervision/retrieval/indexes/my-video-index?api-version=2023-05-01-preview" -H "Ocp-Apim-Subscription-Key: <YOUR_SUBSCRIPTION_KEY>" -H "Content-Type: application/json" --data-ascii "
@@ -145,7 +154,7 @@ Connection: close
145154

146155
### Step 2: Add video files to the index
147156

148-
Next, you can add video files to the index with their associated metadata. The example below demonstrates how to add two video files to the index using SAS URLs to provide access.
157+
Next, you can add video files to the index with their associated metadata. The example below demonstrates how to add two video files to the index using SAS URLs with the **[Create Ingestion](https://eastus.dev.cognitive.microsoft.com/docs/services/ingestion-api-private-preview-2023-05-01-preview/operations/645db36646346106fcc4779f)** API.
149158

150159

151160
```bash
@@ -195,7 +204,7 @@ Connection: close
195204

196205
### Step 3: Wait for ingestion to complete
197206

198-
After you add video files to the index, the ingestion process starts. It might take some time depending on the size and number of files. To ensure the ingestion is complete before performing searches, you can use the **Get Ingestion** call to check the status. Wait for this call to return `"state" = "Completed"` before proceeding to the next step.
207+
After you add video files to the index, the ingestion process starts. It might take some time depending on the size and number of files. To ensure the ingestion is complete before performing searches, you can use the **[Get Ingestion](https://eastus.dev.cognitive.microsoft.com/docs/services/ingestion-api-private-preview-2023-05-01-preview/operations/645db36646346106fcc477a0)** API to check the status. Wait for this call to return `"state" = "Completed"` before proceeding to the next step.
199208

200209
```bash
201210
curl.exe -v _X GET "https://<YOUR_ENDPOINT_URL>/computervision/retrieval/indexes/my-video-index/ingestions?api-version=2023-05-01-preview&$top=20" -H "ocp-apim-subscription-key: <YOUR_SUBSCRIPTION_KEY>"
@@ -230,7 +239,7 @@ After you add video files to the index, you can search for specific videos using
230239

231240
#### Search with "vision" feature
232241

233-
To perform a search using the "vision" feature, specify the query text and any desired filters.
242+
To perform a search using the "vision" feature, use the [Search By Text](https://eastus.dev.cognitive.microsoft.com/docs/services/ingestion-api-private-preview-2023-05-01-preview/operations/645db36646346106fcc477a2) API with the `vision` filter, specifying the query text and any other desired filters.
234243

235244
```bash
236245
POST -v -X "https://<YOUR_ENDPOINT_URL>/computervision/retrieval/indexes/my-video-index:queryByText?api-version=2023-05-01-preview" -H "Ocp-Apim-Subscription-Key: <YOUR_SUBSCRIPTION_KEY>" -H "Content-Type: application/json" --data-ascii "
@@ -293,7 +302,7 @@ Connection: close
293302

294303
#### Search with "speech" feature
295304

296-
To perform a search using the "speech" feature, provide the query text and any desired filters.
305+
To perform a search using the "speech" feature, use the **[Search By Text](https://eastus.dev.cognitive.microsoft.com/docs/services/ingestion-api-private-preview-2023-05-01-preview/operations/645db36646346106fcc477a2)** API with the `speech` filter, providing the query text and any other desired filters.
297306

298307
```bash
299308
curl.exe -v -X POST "https://<YOUR_ENDPOINT_URL>com/computervision/retrieval/indexes/my-video-index:queryByText?api-version=2023-05-01-preview" -H "Ocp-Apim-Subscription-Key: <YOUR_SUBSCRIPTION_KEY>" -H "Content-Type: application/json" --data-ascii "

articles/ai-services/computer-vision/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,10 @@ items:
396396
href: spatial-analysis-camera-placement.md
397397
- name: All Azure AI containers
398398
href: ../cognitive-services-container-support.md?context=%2fazure%2fai-services%2fcomputer-vision%2fcontext%2fcontext
399+
- name: Reference
400+
items:
401+
- name: Video Retrieval REST API
402+
href: https://eastus.dev.cognitive.microsoft.com/docs/services/ingestion-api-private-preview-2023-05-01-preview/operations/645db36646346106fcc4779b
399403
- name: How-to guides
400404
items:
401405
- name: Enterprise readiness
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
title: Azure OpenAI Service fine-tuning considerations
3+
description: Learn more about what you should take into consideration before fine-tuning with Azure OpenAI Service
4+
services: cognitive-services
5+
manager: nitinme
6+
ms.service: azure-ai-openai
7+
ms.topic: conceptual
8+
ms.date: 10/23/2023
9+
author: mrbullwinkle
10+
ms.author: mbullwin
11+
recommendations: false
12+
ms.custom:
13+
---
14+
15+
# When to use Azure OpenAI fine-tuning
16+
17+
When deciding whether or not fine-tuning is the right solution to explore for a given use case, there are some key terms that it's helpful to be familiar with:
18+
19+
- [Prompt Engineering](/azure/ai-services/openai/concepts/prompt-engineering) is a technique that involves designing prompts for natural language processing models. This process improves accuracy and relevancy in responses, optimizing the performance of the model.
20+
- [Retrieval Augmented Generation (RAG)](/azure/machine-learning/concept-retrieval-augmented-generation?view=azureml-api-2&preserve-view=true) improves Large Language Model (LLM) performance by retrieving data from external sources and incorporating it into a prompt. RAG allows businesses to achieve customized solutions while maintaining data relevance and optimizing costs.
21+
- [Fine-tuning](/azure/ai-services/openai/how-to/fine-tuning?pivots=programming-language-studio) retrains an existing Large Language Model using example data, resulting in a new "custom" Large Language Model that has been optimized using the provided examples.
22+
23+
## What is Fine Tuning with Azure OpenAI?
24+
25+
When we talk about fine tuning, we really mean *supervised fine-tuning* not continuous pre-training or Reinforcement Learning through Human Feedback (RLHF). Supervised fine-tuning refers to the process of retraining pre-trained models on specific datasets, typically to improve model performance on specific tasks or introduce information that wasn't well represented when the base model was originally trained.
26+
27+
Fine-tuning is an advanced technique that requires expertise to use appropriately. The questions below will help you evaluate whether you are ready for fine-tuning, and how well you've thought through the process. You can use these to guide your next steps or identify other approaches that might be more appropriate.
28+
29+
## Why do you want to fine-tune a model?
30+
31+
- You should be able to clearly articulate a specific use case for fine-tuning and identify the [model](models.md#fine-tuning-models-preview) you hope to fine-tune.
32+
- Good use cases for fine-tuning include steering the model to output content in a specific and customized style, tone, or format, or scenarios where the information needed to steer the model is too long or complex to fit into the prompt window.
33+
34+
**Common signs you might not be ready for fine-tuning yet:**
35+
36+
- No clear use case for fine tuning, or an inability to articulate much more than “I want to make a model better”.
37+
- If you identify cost as your primary motivator, proceed with caution. Fine-tuning might reduce costs for certain use cases by shortening prompts or allowing you to use a smaller model but there’s a higher upfront cost to training and you will have to pay for hosting your own custom model. Refer to the [pricing page](https://azure.microsoft.com/pricing/details/cognitive-services/openai-service/) for more information on Azure OpenAI fine-tuning costs.
38+
- If you want to add out of domain knowledge to the model, you should start with retrieval augmented generation (RAG) with features like Azure OpenAI's [on your data](./use-your-data.md) or [embeddings](../tutorials/embeddings.md). Often, this is a cheaper, more adaptable, and potentially more effective option depending on the use case and data.
39+
40+
## What have you tried so far?
41+
42+
Fine-tuning is an advanced capability, not the starting point for your generative AI journey. You should already be familiar with the basics of using Large Language Models (LLMs). You should start by evaluating the performance of a base model with prompt engineering and/or Retrieval Augmented Generation (RAG) to get a baseline for performance.
43+
44+
Having a baseline for performance without fine-tuning is essential for knowing whether or not fine-tuning has improved model performance. Fine-tuning with bad data makes the base model worse, but without a baseline, it's hard to detect regressions.
45+
46+
**If you are ready for fine-tuning you:**
47+
48+
- Should be able to demonstrate evidence and knowledge of Prompt Engineering and RAG based approaches.
49+
- Be able to share specific experiences and challenges with techniques other than fine-tuning that were already tried for your use case.
50+
- Need to have quantitative assessments of baseline performance, whenever possible.
51+
52+
**Common signs you might not be ready for fine-tuning yet:**
53+
54+
- Starting with fine-tuning without having tested any other techniques.
55+
- Insufficient knowledge or understanding on how fine-tuning applies specifically to Large Language Models (LLMs).
56+
- No benchmark measurements to assess fine-tuning against.
57+
58+
## What isn’t working with alternate approaches?
59+
60+
Understanding where prompt engineering falls short should provide guidance on going about your fine-tuning. Is the base model failing on edge cases or exceptions? Is the base model not consistently providing output in the right format, and you can’t fit enough examples in the context window to fix it?
61+
62+
Examples of failure with the base model and prompt engineering will help you identify the data they need to collect for fine-tuning, and how you should be evaluating your fine-tuned model.
63+
64+
Here’s an example: A customer wanted to use GPT-3.5-Turbo to turn natural language questions into queries in a specific, non-standard query language. They provided guidance in the prompt (“Always return GQL”) and used RAG to retrieve the database schema. However, the syntax wasn't always correct and often failed for edge cases. They collected thousands of examples of natural language questions and the equivalent queries for their database, including cases where the model had failed before – and used that data to fine-tune the model. Combining their new fine-tuned model with their engineered prompt and retrieval brought the accuracy of the model outputs up to acceptable standards for use.
65+
66+
**If you are ready for fine-tuning you:**
67+
68+
- Have clear examples on how you have approached the challenges in alternate approaches and what’s been tested as possible resolutions to improve performance.
69+
- You've identified shortcomings using a base model, such as inconsistent performance on edge cases, inability to fit enough few shot prompts in the context window to steer the model, high latency, etc.
70+
71+
**Common signs you might not be ready for fine-tuning yet:**
72+
73+
- Insufficient knowledge from the model or data source.
74+
- Inability to find the right data to serve the model.
75+
76+
## What data are you going to use for fine-tuning?
77+
78+
Even with a great use case, fine-tuning is only as good as the quality of the data that you are able to provide. You need to be willing to invest the time and effort to make fine-tuning work. Different models will require different data volumes but you often need to be able to provide fairly large quantities of high-quality curated data.
79+
80+
Another important point is even with high quality data if your data isn't in the necessary format for fine-tuning you will need to commit engineering resources in order to properly format the data.
81+
82+
| Data | Babbage-002 & Davinci-002 | GPT-3.5-Turbo |
83+
|---|---|---|
84+
| Volume | Thousands of Examples | Thousands of Examples |
85+
| Format | Prompt/Completion | Conversational Chat |
86+
87+
**If you are ready for fine-tuning you:**
88+
89+
- Have identified a dataset for fine-tuning.
90+
- The dataset is in the appropriate format for training.
91+
- Some level of curation has been employed to ensure dataset quality.
92+
93+
**Common signs you might not be ready for fine-tuning yet:**
94+
95+
- Dataset hasn't been identified yet.
96+
- Dataset format doesn't match the model you wish to fine-tune.
97+
98+
## How will you measure the quality of your fine-tuned model?
99+
100+
There isn’t a single right answer to this question, but you should have clearly defined goals for what success with fine-tuning looks like. Ideally, this shouldn't just be qualitative but should include quantitative measures of success like utilizing a holdout set of data for validation, as well as user acceptance testing or A/B testing the fine-tuned model against a base model.
101+
102+
## Next steps
103+
104+
- Watch the [Azure AI Show episode: "To fine-tune or not to fine-tune, that is the question"](https://www.youtube.com/watch?v=0Jo-z-MFxJs)
105+
- Learn more about [Azure OpenAI fine-tuning](../how-to/fine-tuning.md)
106+
- Explore our [fine-tuning tutorial](../tutorials/fine-tune.md)

articles/ai-services/openai/includes/fine-tuning-python.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ ms.author: mbullwin
1212
keywords:
1313
---
1414

15-
<a href="https://github.com/openai/openai-python" target="_blank">Library source code</a> | <a href="https://pypi.org/project/openai/" target="_blank">Package (PyPi)</a> |
15+
## Prerequisites
1616

17+
- Read the [When to use Azure OpenAI fine-tuning guide](../concepts/fine-tuning-considerations.md).
1718
- An Azure subscription. <a href="https://azure.microsoft.com/free/cognitive-services" target="_blank">Create one for free</a>.
1819
- Access granted to Azure OpenAI in the desired Azure subscription.
1920
- An Azure OpenAI resource. For more information, see [Create a resource and deploy a model with Azure OpenAI](../how-to/create-resource.md).

articles/ai-services/openai/includes/fine-tuning-rest.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ keywords:
1414

1515
## Prerequisites
1616

17+
- Read the [When to use Azure OpenAI fine-tuning guide](../concepts/fine-tuning-considerations.md).
1718
- An Azure subscription. <a href="https://azure.microsoft.com/free/cognitive-services" target="_blank">Create one for free</a>.
1819
- Access granted to Azure OpenAI in the desired Azure subscription.
1920
- An Azure OpenAI resource. For more information, see [Create a resource and deploy a model with Azure OpenAI](../how-to/create-resource.md).

articles/ai-services/openai/includes/fine-tuning-studio.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ keywords:
1414

1515
## Prerequisites
1616

17+
- Read the [When to use Azure OpenAI fine-tuning guide](../concepts/fine-tuning-considerations.md).
1718
- An Azure subscription. <a href="https://azure.microsoft.com/free/cognitive-services" target="_blank">Create one for free</a>.
1819
- Access granted to Azure OpenAI in the desired Azure subscription.
1920
- An Azure OpenAI resource that's located in a region that supports fine-tuning of the Azure OpenAI model. Check the [Model summary table and region availability](../concepts/models.md#fine-tuning-models-preview) for the list of available models by region and supported functionality. For more information, see [Create a resource and deploy a model with Azure OpenAI](../how-to/create-resource.md).

articles/ai-services/openai/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ items:
3939
href: ./concepts/content-filter.md
4040
- name: Embeddings
4141
href: ./concepts/understand-embeddings.md
42+
- name: Fine-tuning
43+
href: ./concepts/fine-tuning-considerations.md
4244
- name: Red teaming large language models (LLMs)
4345
href: ./concepts/red-teaming.md
4446
- name: Intro to prompt engineering

articles/aks/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@
188188
href: developer-best-practices-pod-security.md
189189
- name: Back up and recover cluster
190190
href: ../backup/azure-kubernetes-service-backup-overview.md?toc=/azure/aks/toc.json&bc=/azure/aks/breadcrumb/toc.json
191+
- name: Windows containers
192+
href: windows-best-practices.md
191193
- name: How-to guides
192194
items:
193195
- name: Migration

0 commit comments

Comments
 (0)