Image-Text-to-Text
Transformers
Safetensors
diffusion_gemma
fp4
nvfp4
vllm
llm-compressor
compressed-tensors
conversational
8-bit precision
Instructions to use RedHatAI/diffusiongemma-26B-A4B-it-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RedHatAI/diffusiongemma-26B-A4B-it-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="RedHatAI/diffusiongemma-26B-A4B-it-NVFP4") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("RedHatAI/diffusiongemma-26B-A4B-it-NVFP4") model = AutoModelForMultimodalLM.from_pretrained("RedHatAI/diffusiongemma-26B-A4B-it-NVFP4", 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use RedHatAI/diffusiongemma-26B-A4B-it-NVFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RedHatAI/diffusiongemma-26B-A4B-it-NVFP4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RedHatAI/diffusiongemma-26B-A4B-it-NVFP4", "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/RedHatAI/diffusiongemma-26B-A4B-it-NVFP4
- SGLang
How to use RedHatAI/diffusiongemma-26B-A4B-it-NVFP4 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 "RedHatAI/diffusiongemma-26B-A4B-it-NVFP4" \ --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": "RedHatAI/diffusiongemma-26B-A4B-it-NVFP4", "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 "RedHatAI/diffusiongemma-26B-A4B-it-NVFP4" \ --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": "RedHatAI/diffusiongemma-26B-A4B-it-NVFP4", "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 RedHatAI/diffusiongemma-26B-A4B-it-NVFP4 with Docker Model Runner:
docker model run hf.co/RedHatAI/diffusiongemma-26B-A4B-it-NVFP4
Commit History
-
Update README.md
Verified signaturec333706
-
Update non-thinking chat template (#3)
- Update non-thinking chat template (b4c1811a2bb3012ca1cc3fa2d12ed3311332f231) Co-authored-by: Caglar Unlu <agesf@users.noreply.huggingface.co>bf3c01c
-
Update README.md (#1)
- Update README.md (73790231d8d0605ec18fa289c60d74b6af165de6) Co-authored-by: Lucas Wilkinson <lwilkinson@users.noreply.huggingface.co>8484b30
-
Update README.md
Verified signatured27cd4a -
Update README.md
Verified signature5f556e7 -
Update README.md
Verified signatureabc2fe5 -
Update README.md
Verified signature9065fdb -
Update README.md
Verified signature55d7ad5
-
Update README.md
Verified signature1518e3a -
Update README.md
Verified signature9640dc1 -
Update README.md
Verified signatured8be994 -
Update README.md
Verified signature1f20c31 -
Update README.md
Verified signaturec8c8772 -
Update README.md
Verified signatureaf55575 -
Update README.md
Verified signaturea203a61 -
Update README.md
Verified signaturee8876d8 -
Update README.md
Verified signaturebf9d2b3 -
Update README.md
Verified signature5e81a82 -
Update README.md
Verified signature7df4084 -
Update README.md
Verified signature7e2c3b9 -
Update README.md
Verified signaturebfd7fe6 -
Update README.md
Verified signature3f029a2 -
Update README.md
Verified signature20716a6 -
Update README.md
Verified signature17327b2 -
Create README.md
Verified signature04153c7 -
Upload folder using huggingface_hub
Verified signaturebe87af2 -
initial commit
Verified signaturebd33252