Instructions to use google/gemma-4-12B-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/gemma-4-12B-it with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("google/gemma-4-12B-it") model = AutoModelForMultimodalLM.from_pretrained("google/gemma-4-12B-it", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- AMD Developer Cloud
Fairly Useless - (well not really after finding the real culprit)
Trying out 12B as it's encoderless and promising, however when i give it tasks it ends up giving me pseudo garbage. Ask it to OCR, and says the text is a pseudo or alien language. I ask it to make a SVG of some line art and it gets into the process of theory of making an SVG rather than actually doing anything.
Although it did output reasonable overview of a song i gave it, but that's beside the point.
Not impressed with this model.
Note: Using KoboldCPP and a i1-Q6_K GGUF version.
Hi @yano2mch ,
Thanks for reporting this issue. Could you please provide us code snippet and full output traces that generated these issues? Having the full code snippet and full output traces will help us for further investigation.
Hi @yano2mch ,
Thanks for reporting this issue. Could you please provide us code snippet and full output traces that generated these issues? Having the full code snippet and full output traces will help us for further investigation.
I am not familiar enough with any of the tools nor is my setup anything close to standard, so no. Though I was using KoboldCPP (v1.115), and i just told it to OCR the page.
However i can provide the image i was trying to OCR. I suspect it might have been a result of the camera leaving a white shadow/outline (for whatever reason?). Though even when i did a threshold basically turning it black and white, it still wouldn't identify the letters. It was a test page where if i get enough return i may OCR the book. Alas not in this case. As you can see it's clearly legible.
Hi @yano2mch ,
Thanks for sharing the details with the image. Could you please try one page at a time and let us know if the issue still persists.
Update, experimenting with G4 26B finetune and getting decent results. But then the question of automating it, so looking at the API portion from KoboldCPP says you effectively just uu64 encode. So i took the UU64 image data that was visible and saved as a file.
The results i saw that were woefully incomplete (due to trimming) but told me it wasn't the 12B model rather the input image was squashed then badly compressed, thus giving a VERY low quality image (1920x1080 to 960x640). Maybe this was to make sure it fit within context size, or maybe it was just a default setting that was had no explanations, but in the JFIF i can see the background and page partially telling me my original annoyances in opening this thread probably weren't the 12B's fault in the first place.
So i'm sorry on that.
Here you can see the upper left corner where the page(s) are and the woodgrain notch, vs the original i posted.
edit: As a side note (still with the G4 26B model since that's what's loaded), manually clipped out a single page and fed it full resolution (521x851) and it OCR'd it perfectly even with curvature of text.
So yeah... fun fun....

