Merge pull request #49 from unslothai/feature/default-param-yaml
Yaml config for default parameters
This commit is contained in:
commit
affd52e868
1 changed files with 4 additions and 2 deletions
|
|
@ -77,9 +77,11 @@ class Config(BaseModel):
|
|||
"""Return kwargs for trainer.prepare_model_for_training()."""
|
||||
# Determine target modules based on model type
|
||||
if use_lora and is_vision:
|
||||
target_modules = "all-linear" if self.lora.vision_all_linear else []
|
||||
# Vision models expect a string (e.g., "all-linear"); fall back to None to use trainer defaults
|
||||
target_modules = "all-linear" if self.lora.vision_all_linear else None
|
||||
else:
|
||||
target_modules = [m.strip() for m in self.lora.target_modules.split(",") if m.strip()]
|
||||
parsed = [m.strip() for m in str(self.lora.target_modules).split(",") if m and m.strip()]
|
||||
target_modules = parsed or None
|
||||
|
||||
return {
|
||||
"use_lora": use_lora,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue