Skip to content

Commit

Permalink
Merge pull request #148 from Haidra-Org/main
Browse files Browse the repository at this point in the history
fix: allow floats for model requirement values
  • Loading branch information
tazlin authored Sep 30, 2024
2 parents de4ce62 + 825cf0e commit d1a64a9
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 34 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/maintests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,10 @@ on:
- '.github/workflows/maintests.yml'
- '.github/workflows/prtests.yml'
- '.github/workflows/release.yml'
- '.pre-commit-config.yaml'
- 'requirements.txt'
- 'requirements.dev.txt'
- 'requirements.docs.txt'
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run pre-commit
uses: pre-commit/action@v3.0.0
with:
extra_args: --all-files

no_extra_fields:
env:
AIWORKER_CACHE_HOME: ${{ github.workspace }}/.cache
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/prtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,10 @@ on:
- '.github/workflows/maintests.yml'
- '.github/workflows/prtests.yml'
- '.github/workflows/release.yml'
- '.pre-commit-config.yaml'
- 'requirements.txt'
- 'requirements.dev.txt'
- 'requirements.docs.txt'
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Run pre-commit
uses: pre-commit/action@v3.0.0
with:
extra_args: --all-files

no_extra_fields:
env:
AIWORKER_CACHE_HOME: ${{ github.workspace }}/.cache
Expand Down
17 changes: 14 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,26 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 24.4.2
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.7
rev: v0.6.8
hooks:
- id: ruff
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.10.0'
rev: 'v1.11.2'
hooks:
- id: mypy
additional_dependencies: [pydantic, types-requests, types-pytz, types-setuptools, types-urllib3, StrEnum]
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: []
submodules: false
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 | 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
12 changes: 6 additions & 6 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pytest==8.2.1
mypy==1.10.0
black==24.4.2
ruff==0.4.7
tox~=4.15.0
pre-commit~=3.7.1
pytest==8.3.3
mypy==1.11.2
black==24.8.0
ruff==0.6.8
tox~=4.20.0
pre-commit~=3.8.0
build>=0.10.0
coverage>=7.2.7

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 d1a64a9

Please sign in to comment.