调用Azure AI Studio中Llama-3端点时遭遇424 HTTP错误求助
Azure AI Studio部署Llama-3-70B-Instruct后调用completions端点报424错误问题
问题详情
- 在Azure AI Studio完成meta-llama-3-70b-instruct模型部署
- 调用
https://<deploymentname>.westeurope.inference.ml.azure.com/score/v1/chat/completions端点时,返回424 FailedDependency错误 - 使用Playground中「查看代码」生成的示例代码(已替换API Key和部署名称)测试,仍触发相同错误;但直接在Playground操作该部署可正常运行
- 错误响应头核心信息:
- 状态码:FailedDependency
ms-azureml-model-error-reason: model_errorms-azureml-model-error-statuscode: 404
- 多次创建新部署测试,问题未解决
- 更新:调用端点
https://<deploymentname>.westeurope.inference.ml.azure.com/score/可正常运行
示例代码(Playground生成)
static async Task InvokeRequestResponseService() { var handler = new HttpClientHandler() { ClientCertificateOptions = ClientCertificateOption.Manual, ServerCertificateCustomValidationCallback = (httpRequestMessage, cert, cetChain, policyErrors) => { return true; } }; using (var client = new HttpClient(handler)) { var requestBody = @"{ ""input_data"": { ""input_string"": [ { ""role"": ""user"", ""content"": ""I am going to Paris, what should I see?"" }, { ""role"": ""assistant"", ""content"": ""Paris, the capital of France, is known for its stunning architecture, art museums, historical landmarks, and romantic atmosphere. Here are some of the top attractions to see in Paris:\n\n1. The Eiffel Tower: The iconic Eiffel Tower is one of the most recognizable landmarks in the world and offers breathtaking views of the city.\n2. The Louvre Museum: The Louvre is one of the world's largest and most famous museums, housing an impressive collection of art and artifacts, including the Mona Lisa.\n3. Notre-Dame Cathedral: This beautiful cathedral is one of the most famous landmarks in Paris and is known for its Gothic architecture and stunning stained glass windows.\n\nThese are just a few of the many attractions that Paris has to offer. With so much to see and do, it's no wonder that Paris is one of the most popular tourist destinations in the world."" }, { ""role"": ""user"", ""content"": ""What is so great about #1?"" } ], ""parameters"": { ""temperature"": 0.8, ""top_p"": 0.8, ""max_new_tokens"": 128 } } }"; const string apiKey = "<my key>"; if (string.IsNullOrEmpty(apiKey)) { throw new Exception("A key should be provided to invoke the endpoint"); } client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue( "Bearer", apiKey); client.BaseAddress = new Uri("https://<deploymentname>.westeurope.inference.ml.azure.com/score/v1/chat/completions"); var content = new StringContent(requestBody); content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); HttpResponseMessage response = await client.PostAsync("", content); if (response.IsSuccessStatusCode) { string result = await response.Content.ReadAsStringAsync(); Console.WriteLine("Result: {0}", result); } else { Console.WriteLine(string.Format("The request failed with status code: {0}", response.StatusCode)); Console.WriteLine(response.Headers.ToString()); string responseContent = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseContent); } } }
疑问
需要调整哪些设置或修改什么内容,才能让/score/v1/chat/completions端点正常工作?
内容的提问来源于stack exchange,提问作者abcdefghijk
相关产品推荐
相关产品推荐

