chore: rename model.size to model.file_size

to disambiguate from RAM size or pixel size
This commit is contained in:
Kevin Turner
2025-04-05 15:05:00 -07:00
committed by psychedelicious
parent e537020c11
commit 52a8ad1c18
12 changed files with 85 additions and 85 deletions

View File

@@ -128,7 +128,7 @@ class ModelConfigBase(ABC, BaseModel):
path: str = Field(
description="Path to the model on the filesystem. Relative paths are relative to the Invoke root directory."
)
size: int = Field(description="The size of the model in bytes.")
file_size: int = Field(description="The size of the model in bytes.")
name: str = Field(description="Name of the model.")
type: ModelType = Field(description="Model type")
format: ModelFormat = Field(description="Model format")
@@ -242,7 +242,7 @@ class ModelConfigBase(ABC, BaseModel):
fields["key"] = fields.get("key") or uuid_string()
fields["description"] = fields.get("description") or f"{base.value} {type.value} model {name}"
fields["repo_variant"] = fields.get("repo_variant") or mod.repo_variant()
fields["size"] = fields.get("size") or mod.size()
fields["file_size"] = fields.get("file_size") or mod.size()
return cls(**fields)

View File

@@ -208,7 +208,7 @@ class ModelProbe(object):
)
fields["format"] = ModelFormat(fields.get("format")) if "format" in fields else probe.get_format()
fields["hash"] = fields.get("hash") or ModelHash(algorithm=hash_algo).hash(model_path)
fields["size"] = fields.get("size") or ModelOnDisk(model_path).size()
fields["file_size"] = fields.get("file_size") or ModelOnDisk(model_path).size()
fields["default_settings"] = fields.get("default_settings")