CoolFace
Modelpublic

eozlu/bagel-canvas-tangram-instruct

sourceHugging Faceapache-2.0updated 8mo agoView on Hugging Face
0likes14downloads
Model Card

BAGEL-Canvas-Tangram-Instruct

This is a fine-tuned version of BAGEL-Canvas trained on the TangramData-Formatted-Colored dataset for tangram puzzle generation with color-aware instructions.

Model Details

  • —Base Model: ByteDance-Seed/BAGEL-7B-MoT (BAGEL-Canvas)
  • —Training Method: LoRA fine-tuning (rank=16, alpha=32)
  • —Training Steps: 2700
  • —Target Modules: qproj, kproj, vproj, oproj, gateproj, upproj, down_proj

Usage

python
import torch
from PIL import Image

# Clone the BAGEL repository for the inferencer
# git clone https://github.com/ByteDance-Seed/BAGEL.git

from inferencer import InterleaveInferencer

# Initialize the inferencer
inferencer = InterleaveInferencer(
    model_path="eozlu/bagel-canvas-tangram-instruct",
    precision="bf16",
    use_flash_attn=True,
)

# Generate a tangram image
prompt = "Create a tangram puzzle of a cat using red, blue, and green pieces."
result = inferencer.generate(
    text=prompt,
    think=True,
    max_new_tokens=512,
    do_sample=True,
    temperature=0.7,
)

# The result contains the generated image
image = result["image"]
image.save("tangram_output.png")

Training Details

Dataset

The model was fine-tuned on TangramData-Formatted-Colored, a dataset of tangram puzzles with:

  • —Colored SVG tangram pieces
  • —Natural language descriptions
  • —Spatial reasoning annotations

Hyperparameters

  • —Learning Rate: 1e-5
  • —Batch Size: 1 (with gradient accumulation)
  • —LoRA Rank: 16
  • —LoRA Alpha: 32
  • —Warmup Steps: 100
  • —Weight Decay: 0.01

License

This model is released under the Apache 2.0 license, following the original BAGEL model license.

Citation

If you use this model, please cite:

bibtex
@article{bagel2024,
  title={BAGEL: Bootstrapped Agentic Generation for Enhanced Learning},
  author={ByteDance Seed Team},
  year={2024}
}

Acknowledgments

  • —ByteDance Seed Team for the original BAGEL model
  • —The tangram dataset contributors