Skip to content

Commit ca353d3

Browse files
committed
fixed pre tokenizer and still working through previous pr
1 parent c73eb68 commit ca353d3

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

gguf-py/gguf/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ class Rope:
154154
DIMENSION_COUNT = "{arch}.rope.dimension_count"
155155
DIMENSION_SECTIONS = "{arch}.rope.dimension_sections"
156156
FREQ_BASE = "{arch}.rope.freq_base"
157+
FREQ_BASE_SWA = "{arch}.rope.freq_base_swa"
157158
SCALING_TYPE = "{arch}.rope.scaling.type"
158159
SCALING_FACTOR = "{arch}.rope.scaling.factor"
159160
SCALING_ATTN_FACTOR = "{arch}.rope.scaling.attn_factor"

gguf-py/gguf/gguf_writer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,9 @@ def add_iclr_lora_rank(self, length: int) -> None:
814814
def add_value_residual_mix_lora_rank(self, length: int) -> None:
815815
self.add_uint32(Keys.Attention.VALUE_RESIDUAL_MIX_LORA_RANK.format(arch=self.arch), length)
816816

817+
def add_rope_freq_base_swa(self, value: float) -> None:
818+
self.add_float32(Keys.Rope.FREQ_BASE_SWA.format(arch=self.arch), value)
819+
817820
def add_gate_lora_rank(self, length: int) -> None:
818821
self.add_uint32(Keys.Attention.GATE_LORA_RANK.format(arch=self.arch), length)
819822

src/llama-vocab.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1857,7 +1857,8 @@ void llama_vocab::impl::load(llama_model_loader & ml, const LLM_KV & kv) {
18571857
tokenizer_pre == "jina-v2-es" ||
18581858
tokenizer_pre == "jina-v2-de" ||
18591859
tokenizer_pre == "a.x-4.0" ||
1860-
tokenizer_pre == "mellum") {
1860+
tokenizer_pre == "mellum" ||
1861+
tokenizer_pre == "modern-bert") {
18611862
pre_type = LLAMA_VOCAB_PRE_TYPE_GPT2;
18621863
} else if (
18631864
tokenizer_pre == "jina-v1-en" ||

0 commit comments

Comments
 (0)