Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: Expose chat template in data options #1582

Merged
merged 1 commit into from
Jan 30, 2025
Merged
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
2 changes: 2 additions & 0 deletions olive/cli/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ def add_dataset_options(sub_parser, required=True, include_train=True, include_e
type=unescaped_str,
help=r"Template to generate text field from. E.g. '### Question: {prompt} \n### Answer: {response}'",
)
text_group.add_argument("--use_chat_template", action="store_true", help="Use chat template for text field.")
dataset_group.add_argument(
"--max_seq_len",
type=int,
Expand Down Expand Up @@ -526,6 +527,7 @@ def update_dataset_options(args, config):
),
((*preprocess_key, "text_cols"), args.text_field),
((*preprocess_key, "text_template"), args.text_template),
((*preprocess_key, "chat_template"), args.use_chat_template),
((*preprocess_key, "max_seq_len"), args.max_seq_len),
((*preprocess_key, "add_special_tokens"), args.add_special_tokens),
((*preprocess_key, "max_samples"), args.max_samples),
Expand Down
Loading