fix(xformers): shush about not having Triton available. (#2701)

It's not readily available on Windows and xformers only uses it on some very specific hardware anyway.
This commit is contained in:
Kevin Turner 2023-02-17 18:02:32 -08:00 committed by GitHub
commit 8aa7d1da55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,3 +2,12 @@ from ._version import __version__
__app_id__= 'invoke-ai/InvokeAI'
__app_name__= 'InvokeAI'
def _ignore_xformers_triton_message_on_windows():
import logging
logging.getLogger("xformers").addFilter(
lambda record: 'A matching Triton is not available' not in record.getMessage())
# In order to be effective, this needs to happen before anything could possibly import xformers.
_ignore_xformers_triton_message_on_windows()