-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue streaming Chinese characters using azure-ai-inference SDK #39565
Comments
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @achauhan-scc @kingernupur @luigiw @needuv @paulshealy1 @singankit. |
Tagging @jhakulin |
@bombert Thanks for reporting this and suggesting a fix! I'm looking into it. |
@bombert which AI model did you use? |
@bombert I've tried several models, but was not able to reproduce the issue. I'll need to see the issue for myself in order to fix it. Please share model name and how the model was deployed. What is the endpoint value above? Feel free to redact personal resource name if relevant. Were you using Azure OpenAI endpoint? GitHub models endpoint |
@dargilco I think this is the line of code to be fixed. ![]() I think the http header from the response has the encoding. BaseAsyncAgentEventHandler has initialize function. See if you can add the response header as an argument. And pass it from the caller and consume in the decode function. |
@howieleung the issue was reported on the Inference SDK, not the AI Projects SDK. But of course, we need to make sure both can handle this rare case. I'll follow up with you 1:1. |
I got same issue. AI model: DeepSeek-R1 Code:
Error messages:
|
Thank you @TshkOtsk, let me try with |
@TshkOtsk Unfortunately I cannot reproduce this with DeepSeek-R1 model either (deployed to my AI Foundry project). I tried with and without Content Safety (which affects the chunking of the streamed response). Did you use exactly the System and User messages specified by @bombert above, or something else? |
Good news @TshkOtsk, I was able to reproduce this once and I have SDK logs. Working on a proper fix and unit-tests. Will update here when I have an update. |
Type of issue
Code doesn't work
Description
Azure AI foundry SDK cannot handle steaming with Chinese characters.
Bug Recreation
FATAL
File 342 line
line_list: List[str] = re.split(r"(?<=\n)", element.decode("utf-8"))
would throw exception when element doesn't end with a complete Chinese character, i.e. '\xe6\x8e\xa8\xe8\x8d'
Fixing Suggestion
Catch the exception and wait next chunk.
The text was updated successfully, but these errors were encountered: