Ensure lora strength is always a float in API and JSON

Force float coercion in both migration paths (load_json and DB read)
and override type detection in get_sequence_keys so lora strength
keys always report as FLOAT regardless of JSON deserialization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-18 23:02:04 +01:00
parent 08338746e2
commit 82e4ba526c
2 changed files with 14 additions and 1 deletions
+3
View File
@@ -168,6 +168,9 @@ def _migrate_lora_keys(data: dict) -> None:
item.setdefault(str_key, 1.0)
elif name_key in item and str_key not in item:
item[str_key] = 1.0
# Ensure strength is always a float (JSON may deserialize 1 as int)
if str_key in item:
item[str_key] = float(item[str_key])
def load_json(path: str | Path) -> tuple[dict[str, Any], float]: