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: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj

Usage

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:

@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
Downloads last month
20
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for eozlu/bagel-canvas-tangram-instruct

Base model

Qwen/Qwen2.5-7B
Finetuned
(19)
this model