Updated Fields

This commit is contained in:
Kent Keirsey 2023-03-28 23:55:02 -04:00
parent e282d2ee7a
commit 78578b1faf

View File

@ -34,16 +34,13 @@ class DiffusersModelInfo(ModelInfo):
repo_id: Optional[str] = Field(description="The repo ID to use for this model") repo_id: Optional[str] = Field(description="The repo ID to use for this model")
path: Optional[str] = Field(description="The path to the model") path: Optional[str] = Field(description="The path to the model")
class modelInfo(ModelInfo):
info: Annotated[Union[CkptModelInfo,DiffusersModelInfo], Field(discriminator="format")]
class CreateModelRequest (BaseModel): class CreateModelRequest (BaseModel):
name: str = Field(description="The name of the model") name: str = Field(description="The name of the model")
info: Annotated[Union[(CkptModelInfo,DiffusersModelInfo)], Field(discriminator="format")] = Field(description="The model info") info: Union[CkptModelInfo, DiffusersModelInfo] = Field(..., discriminator="format", description="The model details and configuration")
class CreateModelResponse (BaseModel): class CreateModelResponse (BaseModel):
name: str = Field(description="The name of the new model") name: str = Field(description="The name of the new model")
info: modelInfo = Field(description="The model details and configuration") info: Union[CkptModelInfo, DiffusersModelInfo] = Field(..., discriminator="format", description="The model details and configuration")
status: str = Field(description="The status of the API response") status: str = Field(description="The status of the API response")
class ModelsList(BaseModel): class ModelsList(BaseModel):