Repository navigation
Conversation
…as JSON fails the job instead of answering []
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
…as JSON fails the job instead of answering []
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
LM output goes through byte-level BPE, so
bpe_decodereturns raw bytes. When generation stops in the middle of a multi-byte character (Cyrillic, CJK, an emoji at the token limit), the caption or lyrics end in an incomplete UTF-8 sequence.request_to_jsonthen fails inside yyjson (invalid UTF-8 is refused by default), gets NULL with a length of 0 and returns an empty string, so/lmanswers[]with status done: a client sees a finished job that planned nothing, and nothing in the log says why.utf8_valid(src/bpe.h): an incomplete sequence at the end is dropped, any other ill-formed byte becomes U+FFFD (overlongs, surrogates and code points above U+10FFFF included).bpe_decodereturns its text through it, so the LM phase-1 text and the understand text are always valid UTF-8. Both callers decode the whole token sequence at once, so no character is cut between calls.request_to_jsonandrequest_writecheck the yyjson result and log the reason;request_to_jsonreturns an empty string on failure, as its header now says./lmand/understandfail the job with a FATAL line when a result cannot be written, instead of answering[].tests/test-utf8.cppcovers the repaired and the untouched cases.Summary by CodeRabbit