Skip to content

Commit

Permalink
Accept tuples for lora.target_modules (#162)
Browse files Browse the repository at this point in the history
Pydantic field is defined as `list`, but in pydantic world, it means
more than just lists. E.g. it allows tuples.

https://docs.pydantic.dev/2.0/usage/types/list_types/

This patch fixes the TypeError raised from the attempt to concatenate a
list with a tuple.

Related: instructlab/instructlab#2021

Signed-off-by: Ihar Hrachyshka <[email protected]>
  • Loading branch information
booxter authored Aug 8, 2024
1 parent 601abe1 commit 0975568
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/instructlab/training/main_ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,8 +638,8 @@ def run_training(torch_args: TorchrunArgs, train_args: TrainingArgs) -> None:
f"--lora_dropout={train_args.lora.dropout}",
"--lora_target_modules",
]
+ train_args.lora.target_modules
)
command.extend(train_args.lora.target_modules)
# hard-code 4-bit quantization for now, change this when we add more
quant_dtype = train_args.lora.quantize_data_type
quantization_is_enabled = quant_dtype in (
Expand Down

0 comments on commit 0975568

Please sign in to comment.