mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
update ui labels
This commit is contained in:
+17
-3
@@ -53,19 +53,33 @@ timer.startup.record("pydantic")
|
||||
|
||||
import diffusers # pylint: disable=W0611,C0411
|
||||
import diffusers.loaders.single_file # pylint: disable=W0611,C0411
|
||||
import huggingface_hub # pylint: disable=W0611,C0411
|
||||
logging.getLogger("diffusers.loaders.single_file").setLevel(logging.ERROR)
|
||||
timer.startup.record("diffusers")
|
||||
|
||||
|
||||
# patch different progress bars
|
||||
import tqdm as tqdm_lib # pylint: disable=C0411
|
||||
from tqdm.rich import tqdm # pylint: disable=W0611,C0411
|
||||
diffusers.loaders.single_file.logging.tqdm = partial(tqdm, unit='C')
|
||||
|
||||
import tqdm as tqdm_lib
|
||||
class _tqdm_cls:
|
||||
class _tqdm_cls():
|
||||
def __call__(self, *args, **kwargs):
|
||||
bar_format = 'Diffusers {rate_fmt}{postfix} {bar} {percentage:3.0f}% {n_fmt}/{total_fmt} {elapsed} {remaining} ' + '\x1b[38;5;71m' + '{desc}' + '\x1b[0m'
|
||||
return tqdm_lib.tqdm(*args, bar_format=bar_format, ncols=80, colour='#327fba', **kwargs)
|
||||
|
||||
class _tqdm_old(tqdm_lib.tqdm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
kwargs.pop("name", None)
|
||||
kwargs['bar_format'] = 'Diffusers {rate_fmt}{postfix} {bar} {percentage:3.0f}% {n_fmt}/{total_fmt} {elapsed} {remaining} ' + '\x1b[38;5;71m' + '{desc}' + '\x1b[0m'
|
||||
kwargs['ncols'] = 80
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
|
||||
transformers.utils.logging.tqdm = _tqdm_cls()
|
||||
diffusers.pipelines.pipeline_utils.logging.tqdm = _tqdm_cls()
|
||||
timer.startup.record("diffusers")
|
||||
huggingface_hub._snapshot_download.hf_tqdm = _tqdm_old # pylint: disable=protected-access
|
||||
|
||||
|
||||
def get_packages():
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user