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
renzhc
diffusers_dcu
Commits
370146e4
Unverified
Commit
370146e4
authored
May 24, 2024
by
Dhruv Nair
Committed by
GitHub
May 24, 2024
Browse files
Use `freedesktop_os_release()` in diffusers cli for Python >=3.10 (#8235)
* update * update
parent
5cd45c24
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
src/diffusers/commands/env.py
src/diffusers/commands/env.py
+7
-1
No files found.
src/diffusers/commands/env.py
View file @
370146e4
...
@@ -31,6 +31,7 @@ from ..utils import (
...
@@ -31,6 +31,7 @@ from ..utils import (
is_transformers_available
,
is_transformers_available
,
is_xformers_available
,
is_xformers_available
,
)
)
from
..utils.testing_utils
import
get_python_version
from
.
import
BaseDiffusersCLICommand
from
.
import
BaseDiffusersCLICommand
...
@@ -105,6 +106,11 @@ class EnvironmentCommand(BaseDiffusersCLICommand):
...
@@ -105,6 +106,11 @@ class EnvironmentCommand(BaseDiffusersCLICommand):
xformers_version
=
xformers
.
__version__
xformers_version
=
xformers
.
__version__
if
get_python_version
()
>=
(
3
,
10
):
platform_info
=
f
"
{
platform
.
freedesktop_os_release
().
get
(
'PRETTY_NAME'
,
None
)
}
-
{
platform
.
platform
()
}
"
else
:
platform_info
=
platform
.
platform
()
is_notebook_str
=
"Yes"
if
is_notebook
()
else
"No"
is_notebook_str
=
"Yes"
if
is_notebook
()
else
"No"
is_google_colab_str
=
"Yes"
if
is_google_colab
()
else
"No"
is_google_colab_str
=
"Yes"
if
is_google_colab
()
else
"No"
...
@@ -152,7 +158,7 @@ class EnvironmentCommand(BaseDiffusersCLICommand):
...
@@ -152,7 +158,7 @@ class EnvironmentCommand(BaseDiffusersCLICommand):
info
=
{
info
=
{
"🤗 Diffusers version"
:
version
,
"🤗 Diffusers version"
:
version
,
"Platform"
:
f
"
{
platform
.
freedesktop_os_release
().
get
(
'PRETTY_NAME'
,
None
)
}
-
{
platform
.
platform
()
}
"
,
"Platform"
:
platform
_info
,
"Running on a notebook?"
:
is_notebook_str
,
"Running on a notebook?"
:
is_notebook_str
,
"Running on Google Colab?"
:
is_google_colab_str
,
"Running on Google Colab?"
:
is_google_colab_str
,
"Python version"
:
platform
.
python_version
(),
"Python version"
:
platform
.
python_version
(),
...
...
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