Run this model with HF Jobs
Run google/gemma-4-E2B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/google/gemma-4-E2B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/google/gemma-4-E2B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use google/gemma-4-E2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/gemma-4-E2B with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("google/gemma-4-E2B") model = AutoModelForMultimodalLM.from_pretrained("google/gemma-4-E2B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Fix: add required prefix argument to parse_response across all usage snippets
#11
by turab1 - opened
169 unmodified lines17017117217317417517653 unmodified lines23023123223323423523651 unmodified lines28828929029129229329452 unmodified lines347348349350351352353169 unmodified linesresponse = processor.decode(outputs[0][input_len:], skip_special_tokens=False)# Parse outputprocessor.parse_response(response)```To enable reasoning, set `enable_thinking=True` and the `parse_response` function will take care of parsing the thinking output.53 unmodified linesresponse = processor.decode(outputs[0][input_len:], skip_special_tokens=False)# Parse outputprocessor.parse_response(response)```</details>51 unmodified linesresponse = processor.decode(outputs[0][input_len:], skip_special_tokens=False)# Parse outputprocessor.parse_response(response)```</details>52 unmodified linesresponse = processor.decode(outputs[0][input_len:], skip_special_tokens=False)# Parse outputprocessor.parse_response(response)```</details>169 unmodified lines17017117217317417517653 unmodified lines23023123223323423523651 unmodified lines28828929029129229329452 unmodified lines347348349350351352353169 unmodified linesresponse = processor.decode(outputs[0][input_len:], skip_special_tokens=False)# Parse outputprocessor.parse_response(response, prefix=inputs["input_ids"])```To enable reasoning, set `enable_thinking=True` and the `parse_response` function will take care of parsing the thinking output.53 unmodified linesresponse = processor.decode(outputs[0][input_len:], skip_special_tokens=False)# Parse outputprocessor.parse_response(response, prefix=inputs["input_ids"])```</details>51 unmodified linesresponse = processor.decode(outputs[0][input_len:], skip_special_tokens=False)# Parse outputprocessor.parse_response(response, prefix=inputs["input_ids"])```</details>52 unmodified linesresponse = processor.decode(outputs[0][input_len:], skip_special_tokens=False)# Parse outputprocessor.parse_response(response, prefix=inputs["input_ids"])```</details>
README.md+4-4