Instructions to use google/gemma-4-E4B-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/gemma-4-E4B-it with Transformers:
# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("google/gemma-4-E4B-it") model = AutoModelForImageTextToText.from_pretrained("google/gemma-4-E4B-it") - Notebooks
- Google Colab
- Kaggle
Error in Mistral Common Package
As mentioned, i have used the code "pip install --upgrade transformers accelerate". I do not include torch there.
When i run the code using one image from my local file via PIL (Image.open()), i get the error:
ImportError: cannot import name 'ReasoningEffort' from 'mistral_common.protocol.instruct.request' (C:\Users\Webbies\AppData\Local\Programs\Python\python311\Lib\site-packages\mistral_common\protocol\instruct\request.py)
My transformers version is 5.5.3 and mistral common version is 1.9.0
how to solve this?
Hi @aniket2025 ,
Thank you for bringing to our attention.
The ImportError you are encountering could be due to a version mismatch where transformers library (v5.5.1+) attempts to load a "Reasoning" feature that is available in newer versions of the mistral-common package.
To resolve this, please install the latest version of mistral-common (v1.10.0 or higher) and let us know if the issue still persists.