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

@@ -85,7 +85,7 @@ example_model_config = {
"config_path": "string",
"key": "string",
"hash": "string",
"size": 1,
"file_size": 1,
"description": "string",
"source": "string",
"converted_at": 0,

View File

@@ -80,7 +80,7 @@ class ModelRecordChanges(BaseModelExcludeNull):
type: Optional[ModelType] = Field(description="Type of model", default=None)
key: Optional[str] = Field(description="Database ID for this model", default=None)
hash: Optional[str] = Field(description="hash of model file", default=None)
size: Optional[int] = Field(description="Size of model file", default=None)
file_size: Optional[int] = Field(description="Size of model file", default=None)
format: Optional[str] = Field(description="format of model file", default=None)
trigger_phrases: Optional[set[str]] = Field(description="Set of trigger phrases for this model", default=None)
default_settings: Optional[MainModelDefaultSettings | ControlAdapterDefaultSettings] = Field(

View File

@@ -15,8 +15,8 @@ class Migration19Callback:
def _add_size_column(self, cursor: sqlite3.Cursor) -> None:
cursor.execute(
"ALTER TABLE models ADD COLUMN size INTEGER "
"GENERATED ALWAYS as (json_extract(config, '$.size')) VIRTUAL NOT NULL"
"ALTER TABLE models ADD COLUMN file_size INTEGER "
"GENERATED ALWAYS as (json_extract(config, '$.file_size')) VIRTUAL NOT NULL"
)
def _populate_size(self, cursor: sqlite3.Cursor) -> None:
@@ -25,7 +25,7 @@ class Migration19Callback:
for model_id, model_path in all_models:
mod = ModelOnDisk(self.models_path / model_path)
cursor.execute(
"UPDATE models SET config = json_set(config, '$.size', ?) WHERE id = ?", (mod.size(), model_id)
"UPDATE models SET config = json_set(config, '$.file_size', ?) WHERE id = ?", (mod.size(), model_id)
)