allenai / allenai/OLMo-core

Molmo2 tokenizer chat template rejects system turns (roles must alternate user/assistant)

Abierto
#849 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
1.5k
Forks
315
Merge medio
1 d 9 h
PR fusionados (30 d)
11

Descripción

**Affects:** the `allenai/Molmo2-4B`/`8B` HF tokenizers' built-in chat template (relevant to the `vision` branch's SFT pipeline and any consumer tokenizing standard SFT data with the tokenizer-native template).

Applying the Molmo2 tokenizer's built-in chat template to conversations containing a system message raises:

```
jinja2.exceptions.TemplateError: Conversation roles must alternate user/assistant/user/assistant/...
```

mm_olmo handled system turns by flattening them into the first user message (`olmo/data/tulu.py`-style `"System: {content}\n{user}"`), but the exported HF template enforces strict user/assistant alternation instead — so real SFT mixes (e.g. `allenai/Dolci-Instruct-SFT`, where many rows carry system turns) cannot be tokenized with the tokenizer-native template.

**Suggested fix:** make the template accept a system role (render it as a proper system turn, or fold it into the first user turn to match mm_olmo training behavior).

Found while mixing text SFT data into stage-2 training in allenai/open-instruct (open-instruct#1856); we work around it with a registered system-capable ChatML template.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.