-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add inference helpers & tests #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
c8ae3cb
Add inference helpers & tests
dbad98c
Support testing with hatch
7e8fbd7
fixes to hatch script
5333836
add inference test action
74d261d
change workflow trigger
e02de5a
widen trigger to test
5cc8f7c
revert changes to workflow triggers
927ffff
Install local python in action
f1eb786
Trigger on push again
4e9ffe5
fix python version
cc7e983
add CODEOWNERS and change triggers
29a39d0
Report tests results
06b9c76
update action versions
0703ef8
format
0cedb25
Fix typo and add refiner helper
9f27cc6
use a shared path loaded from a secret for checkpoints source
2ebd30a
typo fix
129422b
Merge remote-tracking branch 'base/main' into palp/model-tests
8086691
Use device from input and remove duplicated code
2ac4c50
PR feedback
81e1047
fix call to load_model_from_config
5648dce
Move model to gpu
ed78819
Refactor helpers
9283e34
cleanup
da77108
test refiner, prep for 1.0, align with metadata
7c26bde
fix paths on second load
b094614
deduplicate streamlit code
8ae8888
filenames
83d6c66
fixes
89c74b2
add pydantic to requirements
e5a6443
Merge pull request #1 from palp/inference
palp def2cd4
fix usage of `msg` in demo script
dd9a1a7
remove double text
00b8f10
run black
f77d9e5
fix streamlit sampling when returning latents
733dfb3
extract function for streamlit output
959a7ee
another fix for streamlit outputs
cca46d3
fix img2img in streamlit
31056b9
Make fp16 optional and fix device param
87bdf2a
Merge remote-tracking branch 'base/main' into palp/model-tests
42d11ff
PR feedback
733d38b
fix dict cast for dataclass
2cc5425
Merge remote-tracking branch 'base/main' into palp/model-tests
ba60896
run black, update ci script
f811542
cache pip dependencies on hosted runners, remove extra runs
7e86a69
install package in ci env
64b5c9d
fix cache path
f471736
PR cleanup
197a074
one more cleanup
30a7f79
don't cache, it filled up
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.github @Stability-AI/infrastructure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: Run black | ||
on: [push, pull_request] | ||
on: [pull_request] | ||
|
||
jobs: | ||
lint: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ name: Build package | |
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
|
||
jobs: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[pytest] | ||
markers = | ||
inference: mark as inference test (deselect with '-m "not inference"') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.