Text Generation
Transformers
Safetensors
code
gemma
Generated from Trainer
coding
text-generation-inference
Instructions to use MAISAAI/gemma-2b-coder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MAISAAI/gemma-2b-coder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MAISAAI/gemma-2b-coder")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MAISAAI/gemma-2b-coder") model = AutoModelForCausalLM.from_pretrained("MAISAAI/gemma-2b-coder") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use MAISAAI/gemma-2b-coder with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MAISAAI/gemma-2b-coder" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MAISAAI/gemma-2b-coder", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MAISAAI/gemma-2b-coder
- SGLang
How to use MAISAAI/gemma-2b-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 "MAISAAI/gemma-2b-coder" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MAISAAI/gemma-2b-coder", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "MAISAAI/gemma-2b-coder" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MAISAAI/gemma-2b-coder", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MAISAAI/gemma-2b-coder with Docker Model Runner:
docker model run hf.co/MAISAAI/gemma-2b-coder
Adding Evaluation Results
#1
by leaderboard-pr-bot - opened
README.md
CHANGED
|
@@ -1,20 +1,20 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
| 2 |
tags:
|
| 3 |
- generated_from_trainer
|
| 4 |
- code
|
| 5 |
- coding
|
| 6 |
- gemma
|
| 7 |
-
|
| 8 |
-
-
|
| 9 |
-
results: []
|
| 10 |
license_name: gemma-terms-of-use
|
| 11 |
license_link: https://ai.google.dev/gemma/terms
|
| 12 |
-
language:
|
| 13 |
-
- code
|
| 14 |
thumbnail: https://huggingface.co/mrm8488/gemma-2b-coder/resolve/main/logo.png
|
| 15 |
-
datasets:
|
| 16 |
-
- HuggingFaceH4/CodeAlpaca_20K
|
| 17 |
pipeline_tag: text-generation
|
|
|
|
|
|
|
|
|
|
| 18 |
---
|
| 19 |
|
| 20 |
<div style="text-align:center;width:250px;height:250px;">
|
|
@@ -142,4 +142,17 @@ print(generate(instruction))
|
|
| 142 |
|
| 143 |
### Citation
|
| 144 |
|
| 145 |
-
WIP
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- code
|
| 4 |
tags:
|
| 5 |
- generated_from_trainer
|
| 6 |
- code
|
| 7 |
- coding
|
| 8 |
- gemma
|
| 9 |
+
datasets:
|
| 10 |
+
- HuggingFaceH4/CodeAlpaca_20K
|
|
|
|
| 11 |
license_name: gemma-terms-of-use
|
| 12 |
license_link: https://ai.google.dev/gemma/terms
|
|
|
|
|
|
|
| 13 |
thumbnail: https://huggingface.co/mrm8488/gemma-2b-coder/resolve/main/logo.png
|
|
|
|
|
|
|
| 14 |
pipeline_tag: text-generation
|
| 15 |
+
model-index:
|
| 16 |
+
- name: gemma-2b-coder
|
| 17 |
+
results: []
|
| 18 |
---
|
| 19 |
|
| 20 |
<div style="text-align:center;width:250px;height:250px;">
|
|
|
|
| 142 |
|
| 143 |
### Citation
|
| 144 |
|
| 145 |
+
WIP
|
| 146 |
+
# [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
|
| 147 |
+
Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_MAISAAI__gemma-2b-coder)
|
| 148 |
+
|
| 149 |
+
| Metric |Value|
|
| 150 |
+
|---------------------------------|----:|
|
| 151 |
+
|Avg. |45.65|
|
| 152 |
+
|AI2 Reasoning Challenge (25-Shot)|48.98|
|
| 153 |
+
|HellaSwag (10-Shot) |71.43|
|
| 154 |
+
|MMLU (5-Shot) |37.02|
|
| 155 |
+
|TruthfulQA (0-shot) |33.54|
|
| 156 |
+
|Winogrande (5-shot) |66.85|
|
| 157 |
+
|GSM8k (5-shot) |16.07|
|
| 158 |
+
|