Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
fb366891
Commit
fb366891
authored
May 11, 2023
by
AUTOMATIC1111
Committed by
GitHub
May 11, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10274 from akx/torch-cpu-for-tests
Use CPU Torch in CI, etc.
parents
4445314c
5b592669
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
23 deletions
+37
-23
.github/workflows/run_tests.yaml
.github/workflows/run_tests.yaml
+6
-0
launch.py
launch.py
+31
-23
No files found.
.github/workflows/run_tests.yaml
View file @
fb366891
...
...
@@ -17,8 +17,14 @@ jobs:
cache
:
pip
cache-dependency-path
:
|
**/requirements*txt
launch.py
-
name
:
Run tests
run
:
python launch.py --tests test --no-half --disable-opt-split-attention --use-cpu all --skip-torch-cuda-test
env
:
PIP_DISABLE_PIP_VERSION_CHECK
:
"
1"
PIP_PROGRESS_BAR
:
"
off"
TORCH_INDEX_URL
:
https://download.pytorch.org/whl/cpu
WEBUI_LAUNCH_LIVE_OUTPUT
:
"
1"
-
name
:
Upload main app stdout-stderr
uses
:
actions/upload-artifact@v3
if
:
always()
...
...
launch.py
View file @
fb366891
...
...
@@ -22,6 +22,9 @@ stored_commit_hash = None
stored_git_tag
=
None
dir_repos
=
"repositories"
# Whether to default to printing command output
default_command_live
=
(
os
.
environ
.
get
(
'WEBUI_LAUNCH_LIVE_OUTPUT'
)
==
"1"
)
if
'GRADIO_ANALYTICS_ENABLED'
not
in
os
.
environ
:
os
.
environ
[
'GRADIO_ANALYTICS_ENABLED'
]
=
'False'
...
...
@@ -85,32 +88,36 @@ def git_tag():
return
stored_git_tag
def
run
(
command
,
desc
=
None
,
errdesc
=
None
,
custom_env
=
None
,
live
=
False
)
:
def
run
(
command
,
desc
=
None
,
errdesc
=
None
,
custom_env
=
None
,
live
:
bool
=
default_command_live
)
->
str
:
if
desc
is
not
None
:
print
(
desc
)
if
live
:
result
=
subprocess
.
run
(
command
,
shell
=
True
,
env
=
os
.
environ
if
custom_env
is
None
else
custom_env
)
if
result
.
returncode
!=
0
:
raise
RuntimeError
(
f
"""{errdesc or 'Error running command'}.
Command: {command}
Error code: {result.returncode}"""
)
run_kwargs
=
{
"args"
:
command
,
"shell"
:
True
,
"env"
:
os
.
environ
if
custom_env
is
None
else
custom_env
,
"encoding"
:
'utf8'
,
"errors"
:
'ignore'
,
}
return
""
if
not
live
:
run_kwargs
[
"stdout"
]
=
run_kwargs
[
"stderr"
]
=
subprocess
.
PIPE
result
=
subprocess
.
run
(
command
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
shell
=
True
,
env
=
os
.
environ
if
custom_env
is
None
else
custom_env
)
result
=
subprocess
.
run
(
**
run_kwargs
)
if
result
.
returncode
!=
0
:
error_bits
=
[
f
"{errdesc or 'Error running command'}."
,
f
"Command: {command}"
,
f
"Error code: {result.returncode}"
,
]
if
result
.
stdout
:
error_bits
.
append
(
f
"stdout: {result.stdout}"
)
if
result
.
stderr
:
error_bits
.
append
(
f
"stderr: {result.stderr}"
)
raise
RuntimeError
(
"
\n
"
.
join
(
error_bits
))
message
=
f
"""{errdesc or 'Error running command'}.
Command: {command}
Error code: {result.returncode}
stdout: {result.stdout.decode(encoding="utf8", errors="ignore") if len(result.stdout)>0 else '<empty>'}
stderr: {result.stderr.decode(encoding="utf8", errors="ignore") if len(result.stderr)>0 else '<empty>'}
"""
raise
RuntimeError
(
message
)
return
result
.
stdout
.
decode
(
encoding
=
"utf8"
,
errors
=
"ignore"
)
return
(
result
.
stdout
or
""
)
def
check_run
(
command
):
...
...
@@ -135,7 +142,7 @@ def run_python(code, desc=None, errdesc=None):
return
run
(
f
'"{python}" -c "{code}"'
,
desc
,
errdesc
)
def
run_pip
(
command
,
desc
=
None
,
live
=
Fals
e
):
def
run_pip
(
command
,
desc
=
None
,
live
=
default_command_liv
e
):
if
args
.
skip_install
:
return
...
...
@@ -237,13 +244,14 @@ def run_extensions_installers(settings_file):
def
prepare_environment
():
torch_command
=
os
.
environ
.
get
(
'TORCH_COMMAND'
,
"pip install torch==2.0.1 torchvision==0.15.2 --extra-index-url https://download.pytorch.org/whl/cu118"
)
torch_index_url
=
os
.
environ
.
get
(
'TORCH_INDEX_URL'
,
"https://download.pytorch.org/whl/cu118"
)
torch_command
=
os
.
environ
.
get
(
'TORCH_COMMAND'
,
f
"pip install torch==2.0.1 torchvision==0.15.2 --extra-index-url {torch_index_url}"
)
requirements_file
=
os
.
environ
.
get
(
'REQS_FILE'
,
"requirements_versions.txt"
)
xformers_package
=
os
.
environ
.
get
(
'XFORMERS_PACKAGE'
,
'xformers==0.0.17'
)
gfpgan_package
=
os
.
environ
.
get
(
'GFPGAN_PACKAGE'
,
"
git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379
"
)
clip_package
=
os
.
environ
.
get
(
'CLIP_PACKAGE'
,
"
git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1
"
)
openclip_package
=
os
.
environ
.
get
(
'OPENCLIP_PACKAGE'
,
"
git+https://github.com/mlfoundations/open_clip.git@bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b
"
)
gfpgan_package
=
os
.
environ
.
get
(
'GFPGAN_PACKAGE'
,
"
https://github.com/TencentARC/GFPGAN/archive/8d2447a2d918f8eba5a4a01463fd48e45126a379.zip
"
)
clip_package
=
os
.
environ
.
get
(
'CLIP_PACKAGE'
,
"
https://github.com/openai/CLIP/archive/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1.zip
"
)
openclip_package
=
os
.
environ
.
get
(
'OPENCLIP_PACKAGE'
,
"
https://github.com/mlfoundations/open_clip/archive/bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b.zip
"
)
stable_diffusion_repo
=
os
.
environ
.
get
(
'STABLE_DIFFUSION_REPO'
,
"https://github.com/Stability-AI/stablediffusion.git"
)
taming_transformers_repo
=
os
.
environ
.
get
(
'TAMING_TRANSFORMERS_REPO'
,
"https://github.com/CompVis/taming-transformers.git"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment