"vscode:/vscode.git/clone" did not exist on "bce9105ac79636f68dcfdcfc9481b89533db65e5"
Unverified Commit 370146e4 authored by Dhruv Nair's avatar Dhruv Nair Committed by GitHub
Browse files

Use `freedesktop_os_release()` in diffusers cli for Python >=3.10 (#8235)

* update

* update
parent 5cd45c24
...@@ -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(),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment