Skip to content

Commit aecbeb6

Browse files
committed
docs: update HOWTO‑add‑model.md for ModelBase
This patch updates the example in docs/development/HOWTO-add-model.md to use `@ModelBase.register("MyModelForCausalLM")` and `class MyModel(ModelBase)` instead of the outdated `Model` base class. Signed-off-by: Wook Song <[email protected]>
1 parent 3f4fc97 commit aecbeb6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/development/HOWTO-add-model.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ The convert script reads the model configuration, tokenizer, tensor names+data a
2323

2424
The required steps to implement for an HF model are:
2525

26-
1. Define the model `Model.register` annotation in a new `Model` subclass, example:
26+
1. Define the model `ModelBase.register` annotation in a new `ModelBase` subclass, example:
2727

2828
```python
29-
@Model.register("MyModelForCausalLM")
30-
class MyModel(Model):
29+
@ModelBase.register("MyModelForCausalLM")
30+
class MyModel(ModelBase):
3131
model_arch = gguf.MODEL_ARCH.MYMODEL
3232
```
3333

@@ -77,7 +77,7 @@ block_mappings_cfg: dict[MODEL_TENSOR, tuple[str, ...]] = {
7777
Depending on the model configuration, tokenizer, code and tensors layout, you will have to override:
7878
- `Model#set_gguf_parameters`
7979
- `Model#set_vocab`
80-
- `Model#write_tensors`
80+
- `ModelBase#modify_tensors`
8181

8282
NOTE: Tensor names must end with `.weight` or `.bias` suffixes, that is the convention and several tools like `quantize` expect this to proceed the weights.
8383

0 commit comments

Comments
 (0)