mirror of
https://github.com/Stability-AI/generative-models.git
synced 2025-12-31 20:24:24 +01:00
Add inference helpers & tests (#57)
* Add inference helpers & tests * Support testing with hatch * fixes to hatch script * add inference test action * change workflow trigger * widen trigger to test * revert changes to workflow triggers * Install local python in action * Trigger on push again * fix python version * add CODEOWNERS and change triggers * Report tests results * update action versions * format * Fix typo and add refiner helper * use a shared path loaded from a secret for checkpoints source * typo fix * Use device from input and remove duplicated code * PR feedback * fix call to load_model_from_config * Move model to gpu * Refactor helpers * cleanup * test refiner, prep for 1.0, align with metadata * fix paths on second load * deduplicate streamlit code * filenames * fixes * add pydantic to requirements * fix usage of `msg` in demo script * remove double text * run black * fix streamlit sampling when returning latents * extract function for streamlit output * another fix for streamlit outputs * fix img2img in streamlit * Make fp16 optional and fix device param * PR feedback * fix dict cast for dataclass * run black, update ci script * cache pip dependencies on hosted runners, remove extra runs * install package in ci env * fix cache path * PR cleanup * one more cleanup * don't cache, it filled up
This commit is contained in:
1
.github/workflows/CODEOWNERS
vendored
Normal file
1
.github/workflows/CODEOWNERS
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.github @Stability-AI/infrastructure
|
||||
2
.github/workflows/black.yml
vendored
2
.github/workflows/black.yml
vendored
@@ -1,5 +1,5 @@
|
||||
name: Run black
|
||||
on: [push, pull_request]
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
|
||||
1
.github/workflows/test-build.yaml
vendored
1
.github/workflows/test-build.yaml
vendored
@@ -2,6 +2,7 @@ name: Build package
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
|
||||
34
.github/workflows/test-inference.yml
vendored
Normal file
34
.github/workflows/test-inference.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
name: Test inference
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: "Test inference"
|
||||
# This action is designed only to run on the Stability research cluster at this time, so many assumptions are made about the environment
|
||||
if: github.repository == 'stability-ai/generative-models'
|
||||
runs-on: [self-hosted, slurm, g40]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: "Symlink checkpoints"
|
||||
run: ln -s ${{secrets.SGM_CHECKPOINTS_PATH}} checkpoints
|
||||
- name: "Setup python"
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.10"
|
||||
- name: "Install Hatch"
|
||||
run: pip install hatch
|
||||
- name: "Run inference tests"
|
||||
run: hatch run ci:test-inference --junit-xml test-results.xml
|
||||
- name: Surface failing tests
|
||||
if: always()
|
||||
uses: pmeier/pytest-results-action@main
|
||||
with:
|
||||
path: test-results.xml
|
||||
summary: true
|
||||
display-options: fEX
|
||||
fail-on-empty: true
|
||||
Reference in New Issue
Block a user