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/entrypoints/cli/main.py from Cccccz/HY: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/Cccccz/HY/resolve/main/trainer/entrypoints/cli/main.py
- Command line
-
hf download hf://Cccccz/HY/trainer/entrypoints/cli/main.py
-
curl -L -o main.py https://huggingface.co/Cccccz/HY/resolve/main/trainer/entrypoints/cli/main.py
1.15 kB
| # SPDX-License-Identifier: Apache-2.0 | |
| # adapted from vllm: https://github.com/vllm-project/vllm/blob/v0.7.3/vllm/entrypoints/cli/main.py | |
| from trainer.entrypoints.cli.cli_types import CLISubcommand | |
| from trainer.entrypoints.cli.generate import cmd_init as generate_cmd_init | |
| from trainer.utils import FlexibleArgumentParser | |
| def cmd_init() -> list[CLISubcommand]: | |
| """Initialize all commands from separate modules""" | |
| commands = [] | |
| commands.extend(generate_cmd_init()) | |
| return commands | |
| def main() -> None: | |
| parser = FlexibleArgumentParser(description="Trainer CLI") | |
| parser.add_argument('-v', '--version', action='version', version='0.1.0') | |
| subparsers = parser.add_subparsers(required=False, dest="subparser") | |
| cmds = {} | |
| for cmd in cmd_init(): | |
| cmd.subparser_init(subparsers).set_defaults(dispatch_function=cmd.cmd) | |
| cmds[cmd.name] = cmd | |
| args = parser.parse_args() | |
| if args.subparser in cmds: | |
| cmds[args.subparser].validate(args) | |
| if hasattr(args, "dispatch_function"): | |
| args.dispatch_function(args) | |
| else: | |
| parser.print_help() | |
| if __name__ == "__main__": | |
| main() | |