Skip to content

Commit

Permalink
feat: add toggle to pick legacy chat tmpl for granite
Browse files Browse the repository at this point in the history
Signed-off-by: Jaideep Rao <[email protected]>
  • Loading branch information
jaideepr97 committed Nov 13, 2024
1 parent 1a24cce commit 22578e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/instructlab/training/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ class TrainingArgs(BaseModel):
os.path.dirname(__file__), "chat_templates/ibm_generic_tmpl.py"
)

# this field determins if ibm_legacy_tmpl should be used instead
use_legacy_sp_tokens: bool = False

# this field specifies the filepath to the training dataset before processing
data_path: str
ckpt_output_dir: str
Expand Down
6 changes: 6 additions & 0 deletions src/instructlab/training/main_ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,12 @@ def run_training(torch_args: TorchrunArgs, train_args: TrainingArgs) -> None:
"""
check_valid_train_args(train_args)

# switch out generic tmpl for legacy tmpl if requested
if train_args.use_legacy_sp_tokens:
train_args.chat_tmpl_path = os.path.join(
os.path.dirname(__file__), "chat_templates/ibm_legacy_tmpl.py"
)

if train_args.process_data:
dp.main(
DataProcessArgs(
Expand Down

0 comments on commit 22578e4

Please sign in to comment.