Skip to content

Allow mappings between chat template parts and input units#13

Merged
dennislwei merged 13 commits intomainfrom
chat_template
Mar 9, 2026
Merged

Allow mappings between chat template parts and input units#13
dennislwei merged 13 commits intomainfrom
chat_template

Conversation

@dennislwei
Copy link
Member

@dennislwei dennislwei commented Mar 9, 2026

Summary

Adds a unit_ranges parameter to HFModel, VLLMModel, and ProbScalarizedModel to specify mappings from parts of the chat template (conversation turns, documents) to ranges of segmented input units.

Changes

  • HFModel.convert_input / generate: Added unit_ranges parameter and _construct_chat_template_from_mapping() helper that assembles multi-turn conversations and optional context documents from unit index ranges.
  • VLLMModel.convert_input / generate: Same unit_ranges support and _construct_chat_template_from_mapping() helper (mirrors HFModel logic).
  • ProbScalarizedModel.scalarize_output: Passes unit_ranges through to model.convert_input.

@dennislwei dennislwei merged commit dfd4927 into main Mar 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant