Instructions to use gnitoahc/ceed-b1-gemma4-e4b-it-0729 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gnitoahc/ceed-b1-gemma4-e4b-it-0729 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="gnitoahc/ceed-b1-gemma4-e4b-it-0729") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("gnitoahc/ceed-b1-gemma4-e4b-it-0729") model = AutoModelForMultimodalLM.from_pretrained("gnitoahc/ceed-b1-gemma4-e4b-it-0729", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use gnitoahc/ceed-b1-gemma4-e4b-it-0729 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gnitoahc/ceed-b1-gemma4-e4b-it-0729" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gnitoahc/ceed-b1-gemma4-e4b-it-0729", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/gnitoahc/ceed-b1-gemma4-e4b-it-0729
- SGLang
How to use gnitoahc/ceed-b1-gemma4-e4b-it-0729 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "gnitoahc/ceed-b1-gemma4-e4b-it-0729" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gnitoahc/ceed-b1-gemma4-e4b-it-0729", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "gnitoahc/ceed-b1-gemma4-e4b-it-0729" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gnitoahc/ceed-b1-gemma4-e4b-it-0729", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use gnitoahc/ceed-b1-gemma4-e4b-it-0729 with Docker Model Runner:
docker model run hf.co/gnitoahc/ceed-b1-gemma4-e4b-it-0729
CEED B1 — supervised fine-tune of Gemma-4-E4B-it
A standalone checkpoint of google/gemma-4-e4b-it with a LoRA adapter folded
into the weights. Same architecture, config, and processor as the base model —
loadable with plain transformers, no PEFT and no CEED code required.
This is Group B1 of the CEED baselines: supervised
fine-tuning on gold answers with no teacher signal (kd_weight: 0). It is the
no-distillation control, not the primary result.
Usage
from transformers import AutoModelForImageTextToText, AutoProcessor
model = AutoModelForImageTextToText.from_pretrained(
"gnitoahc/ceed-b1-gemma4-e4b-it-0729", dtype="float16", device_map="auto"
)
processor = AutoProcessor.from_pretrained("gnitoahc/ceed-b1-gemma4-e4b-it-0729")
Prompt it the way it was trained and scored — a single user turn containing the image followed by the question — or the reported number will not reproduce.
Training
| Base | google/gemma-4-e4b-it |
| Method | LoRA, rank 4 — 2,269,184 trainable of 7,941,100,832 parameters |
| Steps | 2,000 (one example per step) |
| Corpus | DocVQA (source validation split, re-split 80/10/10 by example id, seed 0) |
| Final train loss | 1.405 (pure cross-entropy; KD term 0.0) |
Evaluation
Greedy decoding, max_new_tokens=64, harness ceed-direct-1.
| Dataset | Split | Metric | n | Score |
|---|---|---|---|---|
| DocVQA | validation | ANLS | 565 | 0.809 |
Held-out validation, not test. No comparison against the untuned base model is claimed here.
Provenance and limitations
ceed_provenance.json in this repo records the source run's config_hash,
param_efficiency, and metrics beside the weights.
- These are LoRA-derived weights. Merging folds
W' = W + (alpha/r)BAinto the base tensors; it does not make the result a full fine-tune. Cite it as a rank-4 LoRA run. - Weights are fp16; the merge arithmetic itself ran in fp32 on CPU.
- Single-domain. Trained and evaluated on DocVQA only. Behaviour on natural images, charts, or non-English documents is untested and inherits whatever the base model does.
- Inherits the base model's limitations and biases, and is subject to the Gemma Terms of Use and the Gemma Prohibited Use Policy.
- Downloads last month
- 18