Skip to content

Commit 6b30372

Browse files
committed
webui ok
1 parent a543ddf commit 6b30372

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/llama-vocab.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,6 +2330,13 @@ void llama_vocab::impl::load(llama_model_loader & ml, const LLM_KV & kv) {
23302330
}
23312331
}
23322332

2333+
// @ngxson : quick hack for gpt-oss
2334+
for (const auto & t : token_to_id) {
2335+
if (t.first == "<|channel|>" || t.first == "<|message|>") {
2336+
id_to_token[t.second].attr = LLAMA_TOKEN_ATTR_USER_DEFINED;
2337+
}
2338+
}
2339+
23332340
// sanity checks
23342341
if (special_eos_id != LLAMA_TOKEN_NULL && special_eog_ids.count(special_eos_id) == 0) {
23352342
special_eog_ids.insert(special_eos_id);

tools/server/public/index.html.gz

6 Bytes
Binary file not shown.

tools/server/webui/src/components/ChatMessage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ export default function ChatMessage({
6262
return { content: msg.content };
6363
}
6464
const REGEX_THINK_OPEN = /<think>|<\|channel\|>analysis<\|message\|>/;
65-
const REGEX_THINK_CLOSE = /<\/think>|<\|channel\|>final<\|message\|>/;
65+
const REGEX_THINK_CLOSE =
66+
/<\/think>|assistant<\|channel\|>final<\|message\|>/;
6667
let actualContent = '';
6768
let thought = '';
6869
let isThinking = false;

0 commit comments

Comments
 (0)