Image-Text-to-Text
Transformers
TensorBoard
Safetensors
GGUF
gemma3
Generated from Trainer
trl
sft
conversational
text-generation-inference
Instructions to use piotrleniartek/eyegemma-1.5-4b-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use piotrleniartek/eyegemma-1.5-4b-it with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="piotrleniartek/eyegemma-1.5-4b-it") 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("piotrleniartek/eyegemma-1.5-4b-it") model = AutoModelForMultimodalLM.from_pretrained("piotrleniartek/eyegemma-1.5-4b-it") 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]:])) - llama-cpp-python
How to use piotrleniartek/eyegemma-1.5-4b-it with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="piotrleniartek/eyegemma-1.5-4b-it", filename="eyegemma-1.5-4b-it.gguf", )
llm.create_chat_completion( 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" } } ] } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use piotrleniartek/eyegemma-1.5-4b-it with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf piotrleniartek/eyegemma-1.5-4b-it # Run inference directly in the terminal: llama-cli -hf piotrleniartek/eyegemma-1.5-4b-it
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf piotrleniartek/eyegemma-1.5-4b-it # Run inference directly in the terminal: llama-cli -hf piotrleniartek/eyegemma-1.5-4b-it
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf piotrleniartek/eyegemma-1.5-4b-it # Run inference directly in the terminal: ./llama-cli -hf piotrleniartek/eyegemma-1.5-4b-it
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf piotrleniartek/eyegemma-1.5-4b-it # Run inference directly in the terminal: ./build/bin/llama-cli -hf piotrleniartek/eyegemma-1.5-4b-it
Use Docker
docker model run hf.co/piotrleniartek/eyegemma-1.5-4b-it
- LM Studio
- Jan
- vLLM
How to use piotrleniartek/eyegemma-1.5-4b-it with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "piotrleniartek/eyegemma-1.5-4b-it" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "piotrleniartek/eyegemma-1.5-4b-it", "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/piotrleniartek/eyegemma-1.5-4b-it
- SGLang
How to use piotrleniartek/eyegemma-1.5-4b-it 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 "piotrleniartek/eyegemma-1.5-4b-it" \ --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": "piotrleniartek/eyegemma-1.5-4b-it", "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 "piotrleniartek/eyegemma-1.5-4b-it" \ --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": "piotrleniartek/eyegemma-1.5-4b-it", "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" } } ] } ] }' - Ollama
How to use piotrleniartek/eyegemma-1.5-4b-it with Ollama:
ollama run hf.co/piotrleniartek/eyegemma-1.5-4b-it
- Unsloth Studio
How to use piotrleniartek/eyegemma-1.5-4b-it with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for piotrleniartek/eyegemma-1.5-4b-it to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for piotrleniartek/eyegemma-1.5-4b-it to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for piotrleniartek/eyegemma-1.5-4b-it to start chatting
- Atomic Chat new
- Docker Model Runner
How to use piotrleniartek/eyegemma-1.5-4b-it with Docker Model Runner:
docker model run hf.co/piotrleniartek/eyegemma-1.5-4b-it
- Lemonade
How to use piotrleniartek/eyegemma-1.5-4b-it with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull piotrleniartek/eyegemma-1.5-4b-it
Run and chat with the model
lemonade run user.eyegemma-1.5-4b-it-{{QUANT_TAG}}List all available models
lemonade list
Model Card for eyegemma-1.5-4b-it
This model is a fine-tuned version of google/medgemma-1.5-4b-it. It has been trained using TRL.
Quick start
from transformers import pipeline
question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
generator = pipeline("text-generation", model="piotrleniartek/eyegemma-1.5-4b-it", device="cuda")
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
print(output["generated_text"])
Training procedure
This model was trained with SFT.
Framework versions
- TRL: 0.28.0
- Transformers: 5.2.0
- Pytorch: 2.10.0+cu128
- Datasets: 4.5.0
- Tokenizers: 0.22.2
Citations
Cite TRL as:
@software{vonwerra2020trl,
title = {{TRL: Transformers Reinforcement Learning}},
author = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif and Gallouédec, Quentin},
license = {Apache-2.0},
url = {https://github.com/huggingface/trl},
year = {2020}
}
- Downloads last month
- 7
Model tree for piotrleniartek/eyegemma-1.5-4b-it
Base model
google/medgemma-1.5-4b-it