Instructions to use Cccccz/HY with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Cccccz/HY with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Cccccz/HY", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Download trainer/logging_utils/formatter.py from Cccccz/HY: direct link, hf CLI and curl.
- Browser
- Download file 999 Bytes
-
https://huggingface.co/Cccccz/HY/resolve/main/trainer/logging_utils/formatter.py
- Command line
-
hf download hf://Cccccz/HY/trainer/logging_utils/formatter.py
-
curl -L -o formatter.py https://huggingface.co/Cccccz/HY/resolve/main/trainer/logging_utils/formatter.py
999 Bytes
| # SPDX-License-Identifier: Apache-2.0 | |
| # adapted from vllm: https://github.com/vllm-project/vllm/blob/v0.7.3/vllm/logging_utils/formatter.py | |
| import logging | |
| class NewLineFormatter(logging.Formatter): | |
| """Adds logging prefix to newlines to align multi-line messages.""" | |
| def __init__(self, fmt, datefmt=None, style="%"): | |
| logging.Formatter.__init__(self, fmt, datefmt, style) | |
| def format(self, record): | |
| msg = logging.Formatter.format(self, record) | |
| if record.message != "": | |
| parts = msg.split(record.message) | |
| msg = msg.replace("\n", "\r\n" + parts[0]) | |
| return msg | |
| def setup_for_distributed(is_master): | |
| """ | |
| This function disables printing when not in master process | |
| """ | |
| import builtins as __builtin__ | |
| builtin_print = __builtin__.print | |
| def print(*args, **kwargs): | |
| force = kwargs.pop('force', False) | |
| if is_master or force: | |
| builtin_print(*args, **kwargs) | |
| __builtin__.print = print | |