Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ImageGenerate_paddle
Commits
f7388a80
Commit
f7388a80
authored
Feb 22, 2024
by
dengjb
Browse files
Update utils.py
parent
df2d8442
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
ui/utils.py
ui/utils.py
+2
-5
No files found.
ui/utils.py
View file @
f7388a80
...
...
@@ -12,11 +12,8 @@ _VAE_SIZE_THRESHOLD_ = 300000000 # vae should not be smaller than this
_MODEL_SIZE_THRESHOLD_
=
3000000000
# model should not be smaller than this
def
compute_gpu_memory
():
import
pynvml
pynvml
.
nvmlInit
()
handle
=
pynvml
.
nvmlDeviceGetHandleByIndex
(
0
)
meminfo
=
pynvml
.
nvmlDeviceGetMemoryInfo
(
handle
)
return
round
(
meminfo
.
total
/
1024
/
1024
/
1024
,
2
)
return
round
(
64
,
2
)
def
empty_cache
():
"""Empty CUDA cache. Essential in stable diffusion pipeline."""
...
...
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