Skip to content

Commit b67e080

Browse files
committed
Upstream fixes: 662192e
1 parent 99c645e commit b67e080

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

conversion/glm.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ def set_vocab(self):
7171
special_vocab._set_special_token("eot", tokenizer.get_added_vocab()["<|user|>"]) # 151336
7272
special_vocab._set_special_token("unk", tokenizer.get_added_vocab()["<|endoftext|>"]) # 151329
7373
special_vocab._set_special_token("eom", tokenizer.get_added_vocab()["<|observation|>"]) # 151338
74-
# Patch broken chat template
75-
if isinstance(special_vocab.chat_template, str) and "visible_text(m.content).endswith" in special_vocab.chat_template:
76-
special_vocab.chat_template = special_vocab.chat_template.replace(
77-
"""{{ visible_text(m.content) }}\n{{- '/nothink' if (enable_thinking is defined and not enable_thinking and not visible_text(m.content).endswith("/nothink")) else '' -}}""",
78-
"""{% set content = visible_text(m.content) %}{{ content }}\n{{- '/nothink' if (enable_thinking is defined and not enable_thinking and not content.endswith("/nothink")) else '' -}}""")
7974
special_vocab.add_to_gguf(self.gguf_writer)
8075

8176
def set_gguf_parameters(self):

conversion/smollm.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,3 @@
1111
@ModelBase.register("SmolLM3ForCausalLM")
1212
class SmolLM3Model(LlamaModel):
1313
model_arch = gguf.MODEL_ARCH.SMOLLM3
14-
15-
def set_vocab(self):
16-
super().set_vocab()
17-
# remove unsupported array slicing in chat template
18-
# ref: https://huggingface.co/ggml-org/SmolLM3-3B-GGUF/discussions/1
19-
from transformers import AutoTokenizer
20-
tokenizer = AutoTokenizer.from_pretrained(self.dir_model)
21-
if tokenizer.chat_template is not None:
22-
chat_template = tokenizer.chat_template.replace("[:]", "")
23-
self.gguf_writer.add_chat_template(chat_template)

0 commit comments

Comments
 (0)