Commit d84b0c2
committed
fix(model): handle missing chat templates
- Update LlamaModel.model_chat_template() to return Optional[str] and accept
name=None for the default model chat template.
- llama_model_chat_template() may return nullptr when no chat template is
available. Handle that case explicitly instead of decoding a null pointer, and
return None so callers can apply their own fallback logic.
Signed-off-by: JamePeng <jame_peng@sina.com>1 parent 1965d5f commit d84b0c2
1 file changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | | - | |
158 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
159 | 161 | | |
160 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
161 | 166 | | |
162 | 167 | | |
163 | 168 | | |
| |||
0 commit comments