Image-Text-to-Text
Transformers
Safetensors
gemma4
coder
coding
merged-lora
kaggle-proof
conversational
Instructions to use josephmayo/gemma-4-E4B-it-Coder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use josephmayo/gemma-4-E4B-it-Coder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="josephmayo/gemma-4-E4B-it-Coder") 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, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("josephmayo/gemma-4-E4B-it-Coder") model = AutoModelForImageTextToText.from_pretrained("josephmayo/gemma-4-E4B-it-Coder") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use josephmayo/gemma-4-E4B-it-Coder with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "josephmayo/gemma-4-E4B-it-Coder" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "josephmayo/gemma-4-E4B-it-Coder", "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/josephmayo/gemma-4-E4B-it-Coder
- SGLang
How to use josephmayo/gemma-4-E4B-it-Coder 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 "josephmayo/gemma-4-E4B-it-Coder" \ --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": "josephmayo/gemma-4-E4B-it-Coder", "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 "josephmayo/gemma-4-E4B-it-Coder" \ --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": "josephmayo/gemma-4-E4B-it-Coder", "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" } } ] } ] }' - Docker Model Runner
How to use josephmayo/gemma-4-E4B-it-Coder with Docker Model Runner:
docker model run hf.co/josephmayo/gemma-4-E4B-it-Coder
| phase,id,latency_s,score,chars,preview | |
| before,HumanEval_0,35.316,0.8,536,"```python | |
| from typing import List | |
| def has_close_elements(numbers: List[float], threshold: float) -> bool: | |
| """""" Check if in given list of numbers, are any two numbers closer to each other than | |
| given threshold. | |
| >>> has_close_elements([1.0, 2.0, 3.0], 0.5) | |
| False | |
| >>> has_close_eleme" | |
| before,HumanEval_1,33.612,0.8,755,"```python | |
| from typing import List | |
| def separate_paren_groups(paren_string: str) -> List[str]: | |
| """""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to | |
| separate those group into separate strings and return the list of those. | |
| Separate groups" | |
| before,HumanEval_2,17.675,0.8,377,"```python | |
| def truncate_number(number: float) -> float: | |
| """""" Given a positive floating point number, it can be decomposed into | |
| and integer part (largest integer smaller than given number) and decimals | |
| (leftover part always smaller than 1). | |
| Return the decimal part of the number. | |
| >>" | |
| before,HumanEval_3,30.553,0.8,610,"```python | |
| from typing import List | |
| def below_zero(operations: List[int]) -> bool: | |
| """""" You're given a list of deposit and withdrawal operations on a bank account that starts with | |
| zero balance. Your task is to detect if at any point the balance of account fallls below zero, and | |
| at that po" | |
| before,HumanEval_4,33.594,0.8,648,"```python | |
| from typing import List | |
| def mean_absolute_deviation(numbers: List[float]) -> float: | |
| """""" For a given list of input numbers, calculate Mean Absolute Deviation | |
| around the mean of this dataset. | |
| Mean Absolute Deviation is the average absolute difference between each | |
| element an" | |
| before,HumanEval_5,29.098,0.8,500,"```python | |
| from typing import List | |
| def intersperse(numbers: List[int], delimeter: int) -> List[int]: | |
| """""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers' | |
| >>> intersperse([], 4) | |
| [] | |
| >>> intersperse([1, 2, 3], 4) | |
| [1, 4, 2, 4, 3] | |
| """""" | |
| " | |
| before,HumanEval_6,33.787,0.55,702,"```python | |
| from typing import List | |
| def parse_nested_parens(paren_string: str) -> List[int]: | |
| """""" Input to this function is a string represented multiple groups for nested parentheses separated by spaces. | |
| For each of the group, output the deepest level of nesting of parentheses. | |
| E.g. (()(" | |
| before,HumanEval_7,21.317,0.8,396,"```python | |
| from typing import List | |
| def filter_by_substring(strings: List[str], substring: str) -> List[str]: | |
| """""" Filter an input list of strings only for ones that contain given substring | |
| >>> filter_by_substring([], 'a') | |
| [] | |
| >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a" | |
| after,HumanEval_0,53.709,0.8,568,"```python | |
| from typing import List | |
| def has_close_elements(numbers: List[float], threshold: float) -> bool: | |
| """""" Check if in given list of numbers, are any two numbers closer to each other than | |
| given threshold. | |
| >>> has_close_elements([1.0, 2.0, 3.0], 0.5) | |
| False | |
| >>> has_close_eleme" | |
| after,HumanEval_1,53.466,0.8,763,"```python | |
| from typing import List | |
| def separate_paren_groups(paren_string: str) -> List[str]: | |
| paren_string = paren_string.replace("" "", """") | |
| groups = [] | |
| balance = 0 | |
| start = 0 | |
| for i, char in enumerate(paren_string): | |
| if char == '(': | |
| balance += 1 | |
| elif char" | |
| after,HumanEval_2,53.294,0.8,824,"```python | |
| def truncate_number(number: float) -> float: | |
| """""" Given a positive floating point number, it can be decomposed into | |
| and an integer part (largest integer smaller than given number) and decimals | |
| (leftover part always smaller than 1). | |
| Return the decimal part of the number. | |
| " | |
| after,HumanEval_3,53.551,0.8,770,"```python | |
| from typing import List | |
| def below_zero(operations: List[int]) -> bool: | |
| """""" You're given a list of deposit and withdrawal operations on a bank account that starts with | |
| zero balance. Your task is to detect if at any point the balance of account fallls below zero, and | |
| at that po" | |
| after,HumanEval_4,53.816,0.8,736,"```python | |
| from typing import List | |
| def mean_absolute_deviation(numbers: List[float]) -> float: | |
| """""" For a given list of input numbers, calculate Mean Absolute Deviation | |
| around the mean of this dataset. | |
| Mean Absolute Deviation is the average absolute difference between each | |
| element an" | |
| after,HumanEval_5,53.518,0.8,643,"```python | |
| from typing import List | |
| def intersperse(numbers: List[int], delimeter: int) -> List[int]: | |
| """""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers' | |
| >>> intersperse([], 4) | |
| [] | |
| >>> intersperse([1, 2, 3], 4) | |
| [1, 4, 2, 4, 3] | |
| """""" | |
| " | |
| after,HumanEval_6,53.528,0.55,701,"```python | |
| from typing import List | |
| def parse_nested_parens(paren_string: str) -> List[int]: | |
| """""" Input to this function is a string represented multiple groups for nested parentheses separated by spaces. | |
| For each of the group, output the deepest level of nesting of parentheses. | |
| E.g. (()(" | |
| after,HumanEval_7,53.317,0.8,739,"```python | |
| from typing import List | |
| def filter_by_substring(strings: List[str], substring: str) -> List[str]: | |
| """""" Filter an input list of strings only for ones that contain given substring | |
| >>> filter_by_substring([], 'a') | |
| [] | |
| >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a" | |