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 executable_eval.json
Browse files- executable_eval.json +135 -0
executable_eval.json
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"before_pass": 5,
|
| 3 |
+
"after_pass": 7,
|
| 4 |
+
"total": 8,
|
| 5 |
+
"rows": [
|
| 6 |
+
{
|
| 7 |
+
"phase": "before",
|
| 8 |
+
"task_id": "HumanEval/0",
|
| 9 |
+
"entry_point": "has_close_elements",
|
| 10 |
+
"passed": false,
|
| 11 |
+
"error": "Traceback (most recent call last):\n File \"C:\\Users\\USER\\AppData\\Local\\Temp\\tmp6oy5omdq.py\", line 8, in <module>\n exec(code, ns)\n ~~~~^^^^^^^^^^\n File \"<string>\", line 17\n if sorted_numbers[i+1] - sorted_numbers[i\n ^\nSyntaxError: '[' was never closed\n",
|
| 12 |
+
"chars": 526
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"phase": "after",
|
| 16 |
+
"task_id": "HumanEval/0",
|
| 17 |
+
"entry_point": "has_close_elements",
|
| 18 |
+
"passed": true,
|
| 19 |
+
"error": null,
|
| 20 |
+
"chars": 495
|
| 21 |
+
},
|
| 22 |
+
{
|
| 23 |
+
"phase": "before",
|
| 24 |
+
"task_id": "HumanEval/1",
|
| 25 |
+
"entry_point": "separate_paren_groups",
|
| 26 |
+
"passed": false,
|
| 27 |
+
"error": "Traceback (most recent call last):\n File \"C:\\Users\\USER\\AppData\\Local\\Temp\\tmpbgx0dlv4.py\", line 10, in <module>\n ns[\"check\"](ns[entry_point])\n ~~~~~~~~~~~^^^^^^^^^^^^^^^^^\n File \"<string>\", line 10, in check\nAssertionError\n",
|
| 28 |
+
"chars": 745
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
"phase": "after",
|
| 32 |
+
"task_id": "HumanEval/1",
|
| 33 |
+
"entry_point": "separate_paren_groups",
|
| 34 |
+
"passed": true,
|
| 35 |
+
"error": null,
|
| 36 |
+
"chars": 455
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
"phase": "before",
|
| 40 |
+
"task_id": "HumanEval/2",
|
| 41 |
+
"entry_point": "truncate_number",
|
| 42 |
+
"passed": true,
|
| 43 |
+
"error": null,
|
| 44 |
+
"chars": 360
|
| 45 |
+
},
|
| 46 |
+
{
|
| 47 |
+
"phase": "after",
|
| 48 |
+
"task_id": "HumanEval/2",
|
| 49 |
+
"entry_point": "truncate_number",
|
| 50 |
+
"passed": true,
|
| 51 |
+
"error": null,
|
| 52 |
+
"chars": 363
|
| 53 |
+
},
|
| 54 |
+
{
|
| 55 |
+
"phase": "before",
|
| 56 |
+
"task_id": "HumanEval/3",
|
| 57 |
+
"entry_point": "below_zero",
|
| 58 |
+
"passed": true,
|
| 59 |
+
"error": null,
|
| 60 |
+
"chars": 590
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
"phase": "after",
|
| 64 |
+
"task_id": "HumanEval/3",
|
| 65 |
+
"entry_point": "below_zero",
|
| 66 |
+
"passed": true,
|
| 67 |
+
"error": null,
|
| 68 |
+
"chars": 590
|
| 69 |
+
},
|
| 70 |
+
{
|
| 71 |
+
"phase": "before",
|
| 72 |
+
"task_id": "HumanEval/4",
|
| 73 |
+
"entry_point": "mean_absolute_deviation",
|
| 74 |
+
"passed": true,
|
| 75 |
+
"error": null,
|
| 76 |
+
"chars": 632
|
| 77 |
+
},
|
| 78 |
+
{
|
| 79 |
+
"phase": "after",
|
| 80 |
+
"task_id": "HumanEval/4",
|
| 81 |
+
"entry_point": "mean_absolute_deviation",
|
| 82 |
+
"passed": true,
|
| 83 |
+
"error": null,
|
| 84 |
+
"chars": 530
|
| 85 |
+
},
|
| 86 |
+
{
|
| 87 |
+
"phase": "before",
|
| 88 |
+
"task_id": "HumanEval/5",
|
| 89 |
+
"entry_point": "intersperse",
|
| 90 |
+
"passed": true,
|
| 91 |
+
"error": null,
|
| 92 |
+
"chars": 486
|
| 93 |
+
},
|
| 94 |
+
{
|
| 95 |
+
"phase": "after",
|
| 96 |
+
"task_id": "HumanEval/5",
|
| 97 |
+
"entry_point": "intersperse",
|
| 98 |
+
"passed": true,
|
| 99 |
+
"error": null,
|
| 100 |
+
"chars": 455
|
| 101 |
+
},
|
| 102 |
+
{
|
| 103 |
+
"phase": "before",
|
| 104 |
+
"task_id": "HumanEval/6",
|
| 105 |
+
"entry_point": "parse_nested_parens",
|
| 106 |
+
"passed": false,
|
| 107 |
+
"error": "Traceback (most recent call last):\n File \"C:\\Users\\USER\\AppData\\Local\\Temp\\tmpx0bb66c4.py\", line 8, in <module>\n exec(code, ns)\n ~~~~^^^^^^^^^^\n File \"<string>\", line 21\n max_depth = max(max_depth\n ^\nSyntaxError: '(' was never closed\n",
|
| 108 |
+
"chars": 692
|
| 109 |
+
},
|
| 110 |
+
{
|
| 111 |
+
"phase": "after",
|
| 112 |
+
"task_id": "HumanEval/6",
|
| 113 |
+
"entry_point": "parse_nested_parens",
|
| 114 |
+
"passed": false,
|
| 115 |
+
"error": "Traceback (most recent call last):\n File \"C:\\Users\\USER\\AppData\\Local\\Temp\\tmpn7um62g2.py\", line 8, in <module>\n exec(code, ns)\n ~~~~^^^^^^^^^^\n File \"<string>\", line 20\n max_depth = max(max_depth\n ^\nSyntaxError: '(' was never closed\n",
|
| 116 |
+
"chars": 691
|
| 117 |
+
},
|
| 118 |
+
{
|
| 119 |
+
"phase": "before",
|
| 120 |
+
"task_id": "HumanEval/7",
|
| 121 |
+
"entry_point": "filter_by_substring",
|
| 122 |
+
"passed": true,
|
| 123 |
+
"error": null,
|
| 124 |
+
"chars": 379
|
| 125 |
+
},
|
| 126 |
+
{
|
| 127 |
+
"phase": "after",
|
| 128 |
+
"task_id": "HumanEval/7",
|
| 129 |
+
"entry_point": "filter_by_substring",
|
| 130 |
+
"passed": true,
|
| 131 |
+
"error": null,
|
| 132 |
+
"chars": 379
|
| 133 |
+
}
|
| 134 |
+
]
|
| 135 |
+
}
|