Run this model with HF Jobs
Run sazid63/gemma-4-e4b-archspec-vision-lora on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/sazid63/gemma-4-e4b-archspec-vision-lora. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/sazid63/gemma-4-e4b-archspec-vision-lora on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use sazid63/gemma-4-e4b-archspec-vision-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use sazid63/gemma-4-e4b-archspec-vision-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("/kaggle/input/models/google/gemma-4/transformers/gemma-4-e4b-it/1") model = PeftModel.from_pretrained(base_model, "sazid63/gemma-4-e4b-archspec-vision-lora") - Notebooks
- Google Colab
- Kaggle
Gemma-4-E4B ArchSpec Vision LoRA — ⚠️ EXPERIMENTAL (smoke run, NOT trained)
This adapter is from an 8-step smoke test (3.3 minutes of training) and must not be used for inference. Post-run eval scored 0% valid archspec-1 on all samples (text and image), and the eval pass hit CUDA OOM. The repo exists to preserve the multimodal adapter structure and config for the upcoming full training run.
What this adapter is
A LoRA adapter for google/gemma-4-e4b-it (multimodal — vision tower + projector verified present in the base model) targeting all three modality paths:
| Path | Modules | Count |
|---|---|---|
| Language model | attention + MLP linears | 258 |
| Multimodal projector | projector linear | 1 |
| Vision tower (SigLIP-style encoder) | attention + MLP linears | 113 |
| Total | 372 modules, 78.9 M trainable params |
LoRA: r=32, alpha=64, dropout=0.05, bias=none, task CAUSAL_LM.
Planned full training configuration
| Task | floor-plan image (or text brief) → archspec-1 JSON (3D apartment spec) |
| Vision pairs | ~45% of data (vision_frac=0.45): real CubiCasa5K apartment photos + synthetic 2D renders (blueprint / CAD / mono styles), letterboxed to 384×384 |
| Text pairs | plain-language brief → archspec-1 |
| Repair pairs | fix invalid archspec-1 JSON → valid spec (ResPlan source) |
| Data sources | Swiss Dwellings, Planify/RPlan, CubiCasa5K, ResPlan — zero-leakage split by unique apartment |
| Image size | 384 px |
| Sequence length | 1664 tokens |
| Optimizer (planned) | AdamW, wd 0.01, LR 1.5e-4, effective batch 12, 2 epochs |
Smoke-run eval (why you shouldn't use it)
- Stock baseline (n=2): 50% parsed, 0% valid archspec — base model can't do the task.
- This 8-step adapter (n=8): 0% parsed — outputs not yet JSON; loss not logged (loss_start/loss_end null); eval generation hit CUDA OOM on 7 of samples on the 14.6 GB T4 (image+16k-token context peak memory).
- Trained with
image_size=384,vision_frac=0.45,max_len=1664.
What a full run still needs
- More steps (2 epochs over the full multimodal mix) — the smoke test proves the data/config wiring works end-to-end.
- Eval OOM fix: smaller eval batch / fewer concurrent image samples / shorter
max_len during eval, or
PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True. - Re-eval against baseline on text, rendered-CAD-image, and real-photo inputs.
Files
| File | Purpose |
|---|---|
adapter_model.safetensors / adapter_config.json |
smoke-run LoRA weights + PEFT config (includes vision-tower + projector targets) |
processor_config.json |
image processor config for the multimodal pipeline |
tokenizer.json, tokenizer_config.json, chat_template.jinja |
tokenizer + chat template from the base model |
Related
- Trained text-only sibling: sazid63/gemma-4-e4b-archspec-lora — same base model, real 950-step QLoRA run, 5/5 valid text→archspec-1 generations.
- Trained in Kaggle kernel
cad-gemma4-archspec-vision-lora(smoke) — dataset builder + trainer inline in that kernel.
- Downloads last month
- -