Image-to-Image
Diffusers
Safetensors
English
agriculture
world-model
plant-growth
developmental-reasoning
image-editing
rice
maize
research
Instructions to use ecnu-icalk/ArgoWM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ecnu-icalk/ArgoWM with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("ecnu-icalk/ArgoWM", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
File size: 666 Bytes
9dc9975 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | """Reuse the reviewed normalized loss with maize-specific output token spans."""
from functools import lru_cache
from pathlib import Path
import sys
from typing import Any
sys.path.insert(0, str(Path(__file__).resolve().parent))
from planner_grouped_loss_plugin import PlannerGroupedLoss, loss_map
from wgsr_v9.maize.grouped_loss import token_groups
class MaizePlannerGroupedLoss(PlannerGroupedLoss):
def __init__(self, args: Any, trainer: Any) -> None:
super().__init__(args, trainer)
self.classify = lru_cache(maxsize=4096)(lambda ids: token_groups(ids, self.tokenizer))
loss_map["wgsr_maize_planner_grouped_v1"] = MaizePlannerGroupedLoss
|