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
Upload proof eval_before_after.csv
Browse files- eval_before_after.csv +150 -0
eval_before_after.csv
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
phase,id,latency_s,score,chars,preview
|
| 2 |
+
before,HumanEval_0,35.316,0.8,536,"```python
|
| 3 |
+
from typing import List
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def has_close_elements(numbers: List[float], threshold: float) -> bool:
|
| 7 |
+
"""""" Check if in given list of numbers, are any two numbers closer to each other than
|
| 8 |
+
given threshold.
|
| 9 |
+
>>> has_close_elements([1.0, 2.0, 3.0], 0.5)
|
| 10 |
+
False
|
| 11 |
+
>>> has_close_eleme"
|
| 12 |
+
before,HumanEval_1,33.612,0.8,755,"```python
|
| 13 |
+
from typing import List
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
def separate_paren_groups(paren_string: str) -> List[str]:
|
| 17 |
+
"""""" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
|
| 18 |
+
separate those group into separate strings and return the list of those.
|
| 19 |
+
Separate groups"
|
| 20 |
+
before,HumanEval_2,17.675,0.8,377,"```python
|
| 21 |
+
def truncate_number(number: float) -> float:
|
| 22 |
+
"""""" Given a positive floating point number, it can be decomposed into
|
| 23 |
+
and integer part (largest integer smaller than given number) and decimals
|
| 24 |
+
(leftover part always smaller than 1).
|
| 25 |
+
|
| 26 |
+
Return the decimal part of the number.
|
| 27 |
+
>>"
|
| 28 |
+
before,HumanEval_3,30.553,0.8,610,"```python
|
| 29 |
+
from typing import List
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
def below_zero(operations: List[int]) -> bool:
|
| 33 |
+
"""""" You're given a list of deposit and withdrawal operations on a bank account that starts with
|
| 34 |
+
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
|
| 35 |
+
at that po"
|
| 36 |
+
before,HumanEval_4,33.594,0.8,648,"```python
|
| 37 |
+
from typing import List
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
def mean_absolute_deviation(numbers: List[float]) -> float:
|
| 41 |
+
"""""" For a given list of input numbers, calculate Mean Absolute Deviation
|
| 42 |
+
around the mean of this dataset.
|
| 43 |
+
Mean Absolute Deviation is the average absolute difference between each
|
| 44 |
+
element an"
|
| 45 |
+
before,HumanEval_5,29.098,0.8,500,"```python
|
| 46 |
+
from typing import List
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
|
| 50 |
+
"""""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
| 51 |
+
>>> intersperse([], 4)
|
| 52 |
+
[]
|
| 53 |
+
>>> intersperse([1, 2, 3], 4)
|
| 54 |
+
[1, 4, 2, 4, 3]
|
| 55 |
+
""""""
|
| 56 |
+
"
|
| 57 |
+
before,HumanEval_6,33.787,0.55,702,"```python
|
| 58 |
+
from typing import List
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
def parse_nested_parens(paren_string: str) -> List[int]:
|
| 62 |
+
"""""" Input to this function is a string represented multiple groups for nested parentheses separated by spaces.
|
| 63 |
+
For each of the group, output the deepest level of nesting of parentheses.
|
| 64 |
+
E.g. (()("
|
| 65 |
+
before,HumanEval_7,21.317,0.8,396,"```python
|
| 66 |
+
from typing import List
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
def filter_by_substring(strings: List[str], substring: str) -> List[str]:
|
| 70 |
+
"""""" Filter an input list of strings only for ones that contain given substring
|
| 71 |
+
>>> filter_by_substring([], 'a')
|
| 72 |
+
[]
|
| 73 |
+
>>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a"
|
| 74 |
+
after,HumanEval_0,53.709,0.8,568,"```python
|
| 75 |
+
from typing import List
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
def has_close_elements(numbers: List[float], threshold: float) -> bool:
|
| 79 |
+
"""""" Check if in given list of numbers, are any two numbers closer to each other than
|
| 80 |
+
given threshold.
|
| 81 |
+
>>> has_close_elements([1.0, 2.0, 3.0], 0.5)
|
| 82 |
+
False
|
| 83 |
+
>>> has_close_eleme"
|
| 84 |
+
after,HumanEval_1,53.466,0.8,763,"```python
|
| 85 |
+
from typing import List
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
def separate_paren_groups(paren_string: str) -> List[str]:
|
| 89 |
+
paren_string = paren_string.replace("" "", """")
|
| 90 |
+
groups = []
|
| 91 |
+
balance = 0
|
| 92 |
+
start = 0
|
| 93 |
+
for i, char in enumerate(paren_string):
|
| 94 |
+
if char == '(':
|
| 95 |
+
balance += 1
|
| 96 |
+
elif char"
|
| 97 |
+
after,HumanEval_2,53.294,0.8,824,"```python
|
| 98 |
+
def truncate_number(number: float) -> float:
|
| 99 |
+
"""""" Given a positive floating point number, it can be decomposed into
|
| 100 |
+
and an integer part (largest integer smaller than given number) and decimals
|
| 101 |
+
(leftover part always smaller than 1).
|
| 102 |
+
|
| 103 |
+
Return the decimal part of the number.
|
| 104 |
+
"
|
| 105 |
+
after,HumanEval_3,53.551,0.8,770,"```python
|
| 106 |
+
from typing import List
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
def below_zero(operations: List[int]) -> bool:
|
| 110 |
+
"""""" You're given a list of deposit and withdrawal operations on a bank account that starts with
|
| 111 |
+
zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
|
| 112 |
+
at that po"
|
| 113 |
+
after,HumanEval_4,53.816,0.8,736,"```python
|
| 114 |
+
from typing import List
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
def mean_absolute_deviation(numbers: List[float]) -> float:
|
| 118 |
+
"""""" For a given list of input numbers, calculate Mean Absolute Deviation
|
| 119 |
+
around the mean of this dataset.
|
| 120 |
+
Mean Absolute Deviation is the average absolute difference between each
|
| 121 |
+
element an"
|
| 122 |
+
after,HumanEval_5,53.518,0.8,643,"```python
|
| 123 |
+
from typing import List
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
def intersperse(numbers: List[int], delimeter: int) -> List[int]:
|
| 127 |
+
"""""" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
|
| 128 |
+
>>> intersperse([], 4)
|
| 129 |
+
[]
|
| 130 |
+
>>> intersperse([1, 2, 3], 4)
|
| 131 |
+
[1, 4, 2, 4, 3]
|
| 132 |
+
""""""
|
| 133 |
+
"
|
| 134 |
+
after,HumanEval_6,53.528,0.55,701,"```python
|
| 135 |
+
from typing import List
|
| 136 |
+
|
| 137 |
+
|
| 138 |
+
def parse_nested_parens(paren_string: str) -> List[int]:
|
| 139 |
+
"""""" Input to this function is a string represented multiple groups for nested parentheses separated by spaces.
|
| 140 |
+
For each of the group, output the deepest level of nesting of parentheses.
|
| 141 |
+
E.g. (()("
|
| 142 |
+
after,HumanEval_7,53.317,0.8,739,"```python
|
| 143 |
+
from typing import List
|
| 144 |
+
|
| 145 |
+
|
| 146 |
+
def filter_by_substring(strings: List[str], substring: str) -> List[str]:
|
| 147 |
+
"""""" Filter an input list of strings only for ones that contain given substring
|
| 148 |
+
>>> filter_by_substring([], 'a')
|
| 149 |
+
[]
|
| 150 |
+
>>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a"
|