Instructions to use cszhilu1998/LiveWorld with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use cszhilu1998/LiveWorld with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("cszhilu1998/LiveWorld", 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
File size: 1,087 Bytes
5024339 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | import argparse
import os
import sys
import warnings
from omegaconf import OmegaConf
import wandb
warnings.filterwarnings("ignore")
os.environ["PYTHONWARNINGS"] = "ignore"
os.environ["TOKENIZERS_PARALLELISM"] = "false"
from liveworld.trainer import Trainer
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--config_path", type=str, required=True)
parser.add_argument("--disable_wandb", action="store_true")
args = parser.parse_args()
config = OmegaConf.load(args.config_path)
# Merge default config if specified
default_config_path = config.get("default_config_path", None)
if default_config_path and os.path.exists(default_config_path):
default_config = OmegaConf.load(default_config_path)
config = OmegaConf.merge(default_config, config)
config.config_name = os.path.basename(args.config_path).split(".")[0]
config.config_path = args.config_path
config.disable_wandb = args.disable_wandb
trainer = Trainer(config)
trainer.train()
wandb.finish()
if __name__ == "__main__":
main()
|