docs: update HOWTO‑add‑model.md for ModelBase and new model classes #14874
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello llama.cpp team,
While working through the
docs/development/HOWTO‑add‑model.md
guide to add a new model, I noticed that the example still uses@Model.register("MyModelForCausalLM")
andclass MyModel(Model)
.In #13023, the model base class was renamed from
Model
toModelBase
, and more recently,TextModel
andMmprojModel
were introduced. Following the current documentation now leads to anAttributeError
.This PR updates the example to use
@ModelBase.register("MyModelForCausalLM")
andclass MyModel(ModelBase)
, bringing the documentation back in line with the current code.Because
TextModel
andMmprojModel
were added, some of the methods that need to be overridden in a new model class have also changed — this PR does not address those changes.If you guys don't mind. I plan to submit a follow‑up PR that updates the override instructions accordingly.
It’s a small fix that should prevent confusion for new contributors, and I intend to continue improving the HOWTO in subsequent PRs. Thank you for your time and consideration.