mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
tidy(mm): remove update
method from ModelConfigBase
It's only used in the soon-to-be-removed model merge logic
This commit is contained in:
parent
a8cd3dfc99
commit
61b737bb9f
@ -129,7 +129,6 @@ class ModelConfigBase(BaseModel):
|
|||||||
key: str = Field(description="unique key for model", default="<NOKEY>")
|
key: str = Field(description="unique key for model", default="<NOKEY>")
|
||||||
hash: Optional[str] = Field(description="original fasthash of model contents", default=None)
|
hash: Optional[str] = Field(description="original fasthash of model contents", default=None)
|
||||||
description: Optional[str] = Field(description="human readable description of the model", default=None)
|
description: Optional[str] = Field(description="human readable description of the model", default=None)
|
||||||
source: Optional[str] = Field(description="model original source (path, URL or repo_id)", default=None)
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def json_schema_extra(schema: dict[str, Any], model_class: Type[BaseModel]) -> None:
|
def json_schema_extra(schema: dict[str, Any], model_class: Type[BaseModel]) -> None:
|
||||||
@ -141,11 +140,6 @@ class ModelConfigBase(BaseModel):
|
|||||||
json_schema_extra=json_schema_extra,
|
json_schema_extra=json_schema_extra,
|
||||||
)
|
)
|
||||||
|
|
||||||
def update(self, attributes: Dict[str, Any]) -> None:
|
|
||||||
"""Update the object with fields in dict."""
|
|
||||||
for key, value in attributes.items():
|
|
||||||
setattr(self, key, value) # may raise a validation error
|
|
||||||
|
|
||||||
|
|
||||||
class CheckpointConfigBase(ModelConfigBase):
|
class CheckpointConfigBase(ModelConfigBase):
|
||||||
"""Model config for checkpoint-style models."""
|
"""Model config for checkpoint-style models."""
|
||||||
|
@ -163,12 +163,8 @@ class ModelMerger(object):
|
|||||||
|
|
||||||
# update model's config
|
# update model's config
|
||||||
model_config = self._installer.record_store.get_model(key)
|
model_config = self._installer.record_store.get_model(key)
|
||||||
model_config.update(
|
model_config.name = merged_model_name
|
||||||
{
|
model_config.description = f"Merge of models {', '.join(model_names)}"
|
||||||
"name": merged_model_name,
|
|
||||||
"description": f"Merge of models {', '.join(model_names)}",
|
|
||||||
"vae": vae,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
self._installer.record_store.update_model(key, model_config)
|
self._installer.record_store.update_model(key, model_config)
|
||||||
return model_config
|
return model_config
|
||||||
|
Loading…
Reference in New Issue
Block a user