This commit is contained in:
Lincoln Stein 2023-11-12 14:20:32 -05:00
parent 024a156114
commit ef8dcf5fae
2 changed files with 8 additions and 7 deletions

View File

@ -87,7 +87,7 @@ async def get_model_record(
) )
async def update_model_record( async def update_model_record(
key: Annotated[str, Path(description="Unique key of model")], key: Annotated[str, Path(description="Unique key of model")],
info: Annotated[AnyModelConfig, Body(description="Model config", discriminator="type")] info: Annotated[AnyModelConfig, Body(description="Model config", discriminator="type")],
) -> AnyModelConfig: ) -> AnyModelConfig:
"""Update model contents with a new config. If the model name or base fields are changed, then the model is renamed.""" """Update model contents with a new config. If the model name or base fields are changed, then the model is renamed."""
logger = ApiDependencies.invoker.services.logger logger = ApiDependencies.invoker.services.logger

View File

@ -50,6 +50,7 @@ def test_type(store: ModelRecordServiceBase):
config1 = store.get_model("key1") config1 = store.get_model("key1")
assert type(config1) == TextualInversionConfig assert type(config1) == TextualInversionConfig
def test_add(store: ModelRecordServiceBase): def test_add(store: ModelRecordServiceBase):
raw = dict( raw = dict(
path="/tmp/foo.ckpt", path="/tmp/foo.ckpt",