Phi-4-Multimodal-Instruct模型在C#azure.ai.ai.inference客户端中拒绝使用“无效输入错误”的音频输入。 我正在尝试通过azure.ai.ai.ai c#客户端使用音频输入的phi-4-multimodal-Instruct模型,但是在发送mp3文件时,我会收到“无效的输入错误”。同样的

问题描述 投票:0回答:1

代码

using Azure; using Azure.AI.Inference; // Azure endpoint configuration var endpoint = new Uri("https://###.services.ai.azure.com/models"); var credential = new AzureKeyCredential("###"); var model = "Phi-4-multimodal-instruct"; var client = new ChatCompletionsClient( endpoint, credential, new AzureAIInferenceClientOptions()); ChatMessageContentItem[] userContent = { new ChatMessageAudioContentItem(audioFilePath: "sample.mp3", AudioContentFormat.Mp3) }; var requestOptions = new ChatCompletionsOptions() { Messages = { new ChatRequestSystemMessage("Based on the attached audio, generate a comprehensive text transcription of the spoken content."), new ChatRequestUserMessage(userContent), }, Model = model, Temperature = 1, MaxTokens = 1000, }; Response<ChatCompletions> response = client.Complete(requestOptions); System.Console.WriteLine(response.Value.Content);

我尝试了什么
与GitHub和Azure终点同时进行的,结果相同
veried mp3是有效的

问题
phi-4-Multimodal-Instruct应该通过C#客户端支持音频输入?
有一种不同的方法来格式化此特定模型的音频输入?

使用此模型对音频文件有任何已知限制或要求?
  • 任何帮助将不胜感激!

修复程序是将音频作为URL而不是Inline二进制数据提供。 API期望音频文件公开访问的URI,这就是为什么INLINE MP3文件引起422错误的原因。

    Solution:
  1. UPLOAD您的mp3文件到可访问的位置。

用基于URI的构造函数将文件路径构造函数重新放置:

c# azure audio azure-ai
1个回答
0
投票

此更改可确保模型以预期格式接收音频。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.