remove xformer prints
This commit is contained in:
@@ -3,11 +3,23 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import warnings
|
import warnings
|
||||||
|
import os
|
||||||
|
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
from modules.timer import startup_timer
|
from modules.timer import startup_timer
|
||||||
|
|
||||||
|
|
||||||
|
class HiddenPrints:
|
||||||
|
def __enter__(self):
|
||||||
|
self._original_stdout = sys.stdout
|
||||||
|
sys.stdout = open(os.devnull, 'w')
|
||||||
|
|
||||||
|
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||||
|
sys.stdout.close()
|
||||||
|
sys.stdout = self._original_stdout
|
||||||
|
|
||||||
|
|
||||||
def imports():
|
def imports():
|
||||||
logging.getLogger("torch.distributed.nn").setLevel(logging.ERROR) # sshh...
|
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())
|
logging.getLogger("xformers").addFilter(lambda record: 'A matching Triton is not available' not in record.getMessage())
|
||||||
@@ -23,10 +35,12 @@ def imports():
|
|||||||
import gradio # noqa: F401
|
import gradio # noqa: F401
|
||||||
startup_timer.record("import gradio")
|
startup_timer.record("import gradio")
|
||||||
|
|
||||||
|
with HiddenPrints():
|
||||||
from modules import paths, timer, import_hook, errors # noqa: F401
|
from modules import paths, timer, import_hook, errors # noqa: F401
|
||||||
startup_timer.record("setup paths")
|
startup_timer.record("setup paths")
|
||||||
|
|
||||||
import ldm.modules.encoders.modules # noqa: F401
|
import ldm.modules.encoders.modules # noqa: F401
|
||||||
|
import ldm.modules.diffusionmodules.model
|
||||||
startup_timer.record("import ldm")
|
startup_timer.record("import ldm")
|
||||||
|
|
||||||
import sgm.modules.encoders.modules # noqa: F401
|
import sgm.modules.encoders.modules # noqa: F401
|
||||||
|
|||||||
Reference in New Issue
Block a user