Skip to content

Commit

Permalink
patch__pkg_resources__packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
w-e-w committed May 25, 2024
1 parent ddb28b3 commit 2cc8955
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions modules/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,24 @@
from modules.timer import startup_timer


def patch__pkg_resources__packaging():
"""temp patch for setuptools >= 70.0.0"""
try:
import pkg_resources
try:
import pkg_resources.packaging
except ImportError:
try:
pkg_resources.packaging = importlib.import_module("pkg_resources.extern.packaging")
except ImportError:
print("Failed to import pkg_resources.packaging")
except ImportError:
pass


def imports():
patch__pkg_resources__packaging()

logging.getLogger("torch.distributed.nn").setLevel(logging.ERROR) # sshh...
logging.getLogger("xformers").addFilter(lambda record: 'A matching Triton is not available' not in record.getMessage())

Expand Down

0 comments on commit 2cc8955

Please sign in to comment.