我在 Azure 区域部署了一个经过精细调整的 GPT 4o 迷你模型northcentralus
。
当我尝试编辑它时,我在 Azure 门户中收到此错误(我想更改最大命中率):
此模型在所选的 Azure OpenAI 服务资源上不可用。详细了解模型可用性。
我在 Azure 门户中选择的资源位于northcentralus
:
但是,https ://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models ?tabs=global-standard%2Cstandard-chat-completions#fine-tuning-models 指出,经过微调的 GPT 4o 迷你模型可在 Azure 区域使用northcentralus
:
我错过了什么?为什么我收到“此模型在所选 Azure OpenAI 服务资源上不可用”的错误?
我按照 Azure 的GPT 微调教程部署了经过微调的 GPT 4o mini 模型。部署阶段的代码如下:
# Deploy fine-tuned model
import json
import requests
token = '[redacted]'
subscription = '[redacted]'
resource_group = "[redacted]"
resource_name = "[redacted]"
model_deployment_name = "gpt-4o-mini-2024-07-18-ft" # Custom deployment name you chose for your fine-tuning model
deploy_params = {'api-version': "2023-05-01"}
deploy_headers = {'Authorization': 'Bearer {}'.format(token), 'Content-Type': 'application/json'}
deploy_data = {
"sku": {"name": "standard", "capacity": 1},
"properties": {
"model": {
"format": "OpenAI",
"name": "gpt-4o-mini-2024-07-18.ft-[redacted]", #retrieve this value from the previous call, it will look like gpt-4o-mini-2024-07-18.ft-[redacted]
"version": "1"
}
}
}
deploy_data = json.dumps(deploy_data)
request_url = f'https://management.azure.com/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.CognitiveServices/accounts/{resource_name}/deployments/{model_deployment_name}'
print('Creating a new deployment...')
r = requests.put(request_url, params=deploy_params, headers=deploy_headers, data=deploy_data)
print(r)
print(r.reason)
print(r.json())
令牌是通过生成的az account get-access-token
。
我已经放弃了那个 Azure UI,这是实现它的 Python 代码。它需要通过 生成的令牌
az account get-access-token
。需要几秒钟才能更新。