Skip to content

Commit

Permalink
fix: set new type hint for other requirements fields
Browse files Browse the repository at this point in the history
Also updates the automatically generated schema files
  • Loading branch information
tazlin committed Sep 30, 2024
1 parent 8bd5607 commit a3e2377
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class RawLegacy_StableDiffusion_ModelRecord(BaseModel):
homepage: str | None = None
nsfw: bool
download_all: bool
requirements: dict[str, int | float | str | list[int] | list[str] | bool] | None = None
requirements: dict[str, int | float | str | list[int] | list[float] | list[str] | bool] | None = None
config: Mapping[str, list[RawLegacy_FileRecord | RawLegacy_DownloadRecord]]
available: bool | None = None
features_not_supported: list[FEATURE_SUPPORTED] | None = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class Legacy_StableDiffusion_ModelRecord(StagingLegacy_Generic_ModelRecord):
homepage: str | None = None
size_on_disk_bytes: int | None = None
optimization: str | None = None
requirements: dict[str, int | str | list[int] | list[str] | bool] | None = None
requirements: dict[str, int | float | str | list[int] | list[float] | list[str] | bool] | None = None


class Legacy_Generic_ModelReference(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion horde_model_reference/model_reference_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class StableDiffusion_ModelRecord(Generic_ModelRecord):
style: MODEL_STYLE | str | None = None
"""The style of the model."""

requirements: dict[str, int | str | list[int] | list[str] | bool] | None = None
requirements: dict[str, int | float | str | list[int] | list[float] | list[str] | bool] | None = None

size_on_disk_bytes: int | None = None

Expand Down
9 changes: 9 additions & 0 deletions legacy_stable_diffusion.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "string"
},
Expand All @@ -251,6 +254,12 @@
},
"type": "array"
},
{
"items": {
"type": "number"
},
"type": "array"
},
{
"items": {
"type": "string"
Expand Down
9 changes: 9 additions & 0 deletions stable_diffusion.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "string"
},
Expand All @@ -293,6 +296,12 @@
},
"type": "array"
},
{
"items": {
"type": "number"
},
"type": "array"
},
{
"items": {
"type": "string"
Expand Down

0 comments on commit a3e2377

Please sign in to comment.