fixes / cleanup

This commit is contained in:
Dan Saunders 2025-12-11 13:20:33 -05:00
commit 7828f77175
3 changed files with 6 additions and 25 deletions

View file

@ -80,7 +80,7 @@ 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 []
target_modules = "all-linear" if self.lora.vision_all_linear else []
else:
target_modules = [m.strip() for m in self.lora.target_modules.split(",") if m.strip()]

View file

@ -46,9 +46,8 @@ def _get_python_type(annotation: Any) -> type:
def _collect_config_fields(config_class: type[BaseModel]) -> list[tuple[str, Any]]:
"""
Collect all fields from a config class, flattening nested models.
Returns list of (name, field_info) tuples.
Raises ValueError on duplicate field names.
Collect all fields from a config class, flattening nested models. Returns list of
(name, field_info) tuples. Raises ValueError on duplicate field names.
"""
fields = []
seen_names: set[str] = set()