Instructions to use google/gemma-4-12B-it-qat-q4_0-unquantized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/gemma-4-12B-it-qat-q4_0-unquantized with Transformers:
# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("google/gemma-4-12B-it-qat-q4_0-unquantized") model = AutoModelForMultimodalLM.from_pretrained("google/gemma-4-12B-it-qat-q4_0-unquantized", device_map="auto") - Notebooks
- Google Colab
- Kaggle
[Bug] Model crash when input contains only images without any accompanying text
[Bug] Model crash when input contains only images without any accompanying text (google/gemma-4-12B-it-qat-q4_0-unquantized)
Description:
I've encountered a consistent issue where the Gemma-4-12B model (VLM) crashes or produces a runtime error when the user input contains only an image without any text instructions or prompts.Environment:
- Model: gemma-4-12B-it-qat-q4_0-unquantized (Multi-modal)
- Inference Engine: llama.cpp / LM Studio
- Format: GGUF (converted with mmproj)
Steps to Reproduce:
- Upload an image to the model.
- Submit the image without typing any characters (no spaces, no words).
- The model/inference engine occasionally crashes or fails to generate a response.
Expected Behavior:
The model should either provide a default description of the image or handle the empty text input gracefully (e.g., by prompting the user for instructions).Actual Behavior:
Occasional crash of the inference process.
gemma-4-12b-it-qat-unquantized@q4_k
Processing Prompt... 100%
This message contains no content. The AI has nothing to say.
Notes:
I am using a QAT (Quantization-Aware Training) version of the model. The issue seems to be related to how the vision-language projector handles an empty sequence of text tokens alongside image tokens.Best regards,
[aifeifei798]
Hi @aifeifei798
Thanks for reporting it . I tried to reproduce the issue using the steps you provided, but I wasn't able to trigger the crash on my end.When submitting an image without any accompanying text, the model handled the empty input gracefully and returned the following expected output :
"It looks like you haven't provided a prompt or a question yet! Please go ahead and type what you'd like me to do."
Could you share a few more details to help us investigate further?
- The exact script or command-line arguments you are using to run llama.cpp or LM Studio.
- Any specific error logs or segmentation fault traces thrown by the inference engine at the exact moment of the crash
- The hardware (GPU) and the specific version/commit of llama.cpp or LM Studio you are currently running.
Thanks