char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Xuan-Son Nguyenconvert: add @ModelBase.example (#27208)fa88ae936

char/aliceai-t5-moe
453 B15 linesraw
1from __future__ import annotations
2
3from .base import ModelBase, TextModel, gguf
4
5
6@ModelBase.register("MaincoderForCausalLM")
7@ModelBase.example("Maincode/Maincoder-1B")
8class MaincoderModel(TextModel):
9    model_arch = gguf.MODEL_ARCH.MAINCODER
10
11    def set_gguf_parameters(self):
12        super().set_gguf_parameters()
13
14        if (head_dim := self.hparams.get("head_dim")) is not None:
15            self.gguf_writer.add_rope_dimension_count(head_dim)