Commit 15741c1
fix(distributed-demo): make apply_chat_template token-id coercion transformers 4.x AND 5.x safe
#105's demo assumed apply_chat_template returns token ids (transformers 4.x);
on transformers 5.x it returns a string -> verifier.prefill got a str and raised
'str object cannot be interpreted as an integer' (hit on the Mac, whose venv runs
transformers 5.x for gemma-4). Pass tokenize=True and coerce str/BatchEncoding/
nested-list to a flat List[int]. Verified on the GPU host (transformers 4.57) and
re-validated on the Mac (5.x).
Co-authored-by: FluffyAIcode <FluffyAIcode@users.noreply.github.com>1 parent f4a4b86 commit 15741c1
1 file changed
Lines changed: 18 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
175 | 181 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
| 182 | + | |
180 | 183 | | |
181 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
182 | 195 | | |
183 | 196 | | |
184 | 197 | | |
| |||
0 commit comments