Commit 4a6c311
committed
refactor(internals): align model metadata wrappers with llama.cpp API
- Use `llama_vocab_n_tokens()` instead of the old vocab size helper.
- Add Python wrappers for model description, size, chat template, and
trained RoPE frequency scaling.
- Clarify model capability helpers with docstrings matching llama.cpp
semantics.
- Rename `desc()` and `size()` to `model_desc()` and `model_size()` to
make their scope explicit.
- Drop the unused `get_tensor()` stub since llama.cpp does not expose it.
- Route rerank template lookup through `LlamaModel.model_chat_template()` for
consistency with the internal model abstraction.
Signed-off-by: JamePeng <jame_peng@sina.com>1 parent 40f0536 commit 4a6c311
3 files changed
Lines changed: 59 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
134 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
135 | 165 | | |
136 | 166 | | |
137 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
138 | 171 | | |
139 | 172 | | |
140 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
141 | 177 | | |
142 | 178 | | |
143 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
144 | 184 | | |
145 | 185 | | |
146 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
147 | 190 | | |
148 | 191 | | |
149 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
150 | 196 | | |
151 | 197 | | |
152 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
153 | 202 | | |
154 | 203 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | 204 | | |
170 | 205 | | |
171 | 206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
696 | 696 | | |
697 | 697 | | |
698 | 698 | | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
699 | 703 | | |
700 | 704 | | |
701 | 705 | | |
702 | 706 | | |
703 | 707 | | |
704 | 708 | | |
705 | | - | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
706 | 713 | | |
707 | 714 | | |
708 | 715 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
307 | | - | |
308 | | - | |
| 306 | + | |
309 | 307 | | |
310 | 308 | | |
311 | 309 | | |
| |||
0 commit comments