Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
- Fix: W&B integration respects WANDB_ARTIFACT_DIR. In addition, new env var WANDB_CACHE_SKIP controls cache use.
- Dropped support for S3 storages without proper SSL certificates.
- Added support for W&B artifacts on local storage which don't need to be downloaded and may be earlier available.
- Hardcoded a date in template formatting application for consistency in eval results.

## 0.2.2

Expand Down
5 changes: 5 additions & 0 deletions src/template_formatting/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,11 @@ def format( # type: ignore[override]
"continue_final_message": is_prefill,
}
)
if "date_string" not in template_kwargs:
# some templates are forcing a date_string, harcoding one here for consistency in evaluations, e.g.
# https://github.com/huggingface/transformers/blob/main/src/transformers/models/llama4/processing_llama4.py
# template_kwargs["date_string"] = "26 Jul 2024"
template_kwargs["date_string"] = "unknown"

return self.tokenizer.apply_chat_template(hf_chat, **template_kwargs)

Expand Down
Loading