Repository navigation
Fix OmniVoice instruct splitting for UTF-8 separators - #1146
Merged
Merged
Conversation
std::regex<char> treats each byte of the full-width comma (EF BC 8C) as a separate character-class member. The 8C byte also occurs in 北, so tags such as 东北话 are split mid-codepoint and rejected. Match the comma as a consecutive byte sequence instead.
Owner
|
@supomarlo Thanks! PR merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
resolve_instruct()rejects the valid东北话instruct tag because theseparator regex splits the UTF-8 character
北in the middle.The fix changes the separator from a byte character class to an explicit
byte-sequence alternation.
Root cause
std::regexisbasic_regex<char>and matches UTF-8 bytes, not Unicode codepoints. The full-width comma
,isEF BC 8C; inside a character class itbecomes three independent byte alternatives.
北isE5 8C 97, so its8Cbyte matches the separator and splits
东北话into two invalid fragments.The server then returns HTTP 500:
{ "error": { "message": "unsupported OmniVoice instruct items: '东�' (unsupported), '�话' (unsupported)", "type": "server_error" } }Fix
\xEF\xBC\x8Cis one consecutive three-byte sequence, so it cannot match the8Cbyte inside北.Verification
Minimal regex reproduction, original vs fixed:
东北话东�/�话东北话female, young adult, low pitch, 东北话东北话intactfemale,东北话东北话intactDirect server test via
POST /v1/audio/speechwithomnivoice_q8_0(Windows x64, MSVC 19.44, Vulkan portable build) before the fix:
东北话female, young adult, low pitch, 四川话female, young adult, low pitch, 东北话After applying only the regex change and rebuilding the same Vulkan portable
configuration:
东北话female, young adult, low pitch, 东北话female,东北话Scope
东北话.instructparsing and validation logic is unchanged.