Downloads · 30 days
16
12% of all-time downloads
Demondiablo/medgemma-4b-it-fp8-w8a8
medgemma-4b-it-fp8-w8a8 is a image-text-to-text model from Demondiablo. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as gemma.
This is an FP8 W8A8 Quantized version of google/medgemma-4b-it optimized for high-throughput, low-latency deployment with vLLM and compatible serving engines.
Downloads · 30 days
16
12% of all-time downloads
All-time downloads
129
Public
Parameters
4.3B
5.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5.4 GB · 99%
How the weights are stored.
F8_E4M33.2B · 75%
From the Hugging Face model README
This is an FP8 W8A8 Quantized version of google/medgemma-4b-it optimized for high-throughput, low-latency deployment with vLLM and compatible serving engines.
google/medgemma-4b-itFP8_DYNAMIC (Weights in FP8 E4M3, dynamic FP8 activations)compressed-tensors (native vLLM format)lm_head, embed_tokens, multi_modal_projector, and vision tower linear layers preserved for accuracy.from vllm import LLM, SamplingParams
model_name = "Demondiablo/medgemma-4b-it-fp8-w8a8"
llm = LLM(
model=model_name,
trust_remote_code=True,
max_model_len=4096,
)
sampling_params = SamplingParams(
temperature=0.2,
max_tokens=2048,
)
prompt = "You are a clinical AI. Summarize the following prescription: Tablet Thyronorm 50 mcg OD."
outputs = llm.generate([prompt], sampling_params)
print(outputs[0].outputs[0].text)
import torch
from transformers import AutoProcessor, AutoModelForImageTextToText
model_name = "Demondiablo/medgemma-4b-it-fp8-w8a8"
processor = AutoProcessor.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForImageTextToText.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
prompt = "Extract medications: Capsule Desula 21 HS, Thyronorm 50 mg OD."
inputs = processor(text=prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=512)
print(processor.decode(outputs[0], skip_special_tokens=True))
Native FP8 W8A8 acceleration is supported on: