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:
@@ -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]:
|
||||
|
||||
Reference in New Issue
Block a user