From 6c8ac51401c1aadc8096d2195b19bdb310b91c03 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 26 Sep 2026 02:22:02 +0000 Subject: [PATCH] Declare jinja2, which training needs to render chat templates CI on main failed test_sample_length with "apply_chat_template requires jinja2 to be installed". transformers renders chat templates with jinja2 but does not depend on it, so a clean install could not build a single training sample. Macs usually had it by accident, through mlx-lm. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017vhZ7i2tU8r4RQ1VBfqfcg --- pyproject.toml | 5 +++++ requirements.txt | 1 + 2 files changed, 6 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index d8f24d6..c8994a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,6 +47,11 @@ classifiers = [ # opted out of. Both live together in the `mlx` extra now, both marked darwin. dependencies = [ "transformers>=4.40.0", + # transformers renders chat templates with jinja2 but does not depend on + # it; without it every training sample fails to render + # (apply_chat_template raises ImportError). A Mac install usually had it + # by accident, through mlx-lm; nothing guaranteed it. + "jinja2>=3.1.0", "safetensors>=0.4.0", "pyyaml>=6.0", "playwright>=1.45.0", diff --git a/requirements.txt b/requirements.txt index cfa790c..8722aba 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,7 @@ mlx-lm>=0.21.0 # Vision: lets the assistant see screenshots instead of guessing from page text. mlx-vlm>=0.6.0 transformers>=4.40.0 +jinja2>=3.1.0 torch safetensors>=0.4.0 pyyaml>=6.0