Text Generation
Transformers
Safetensors
gemma2
llama-factory
full
Generated from Trainer
conversational
text-generation-inference
Instructions to use system-k/gemma-2-2b-think with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use system-k/gemma-2-2b-think with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="system-k/gemma-2-2b-think") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("system-k/gemma-2-2b-think") model = AutoModelForCausalLM.from_pretrained("system-k/gemma-2-2b-think", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use system-k/gemma-2-2b-think with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "system-k/gemma-2-2b-think" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "system-k/gemma-2-2b-think", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/system-k/gemma-2-2b-think
- SGLang
How to use system-k/gemma-2-2b-think 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 "system-k/gemma-2-2b-think" \ --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": "system-k/gemma-2-2b-think", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "system-k/gemma-2-2b-think" \ --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": "system-k/gemma-2-2b-think", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use system-k/gemma-2-2b-think with Docker Model Runner:
docker model run hf.co/system-k/gemma-2-2b-think
sft
This model is a fine-tuned version of google/gemma-2-2b-it on the sk_sky_t1 dataset. It achieves the following results on the evaluation set:
- Loss: 0.3965
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 1e-05
- train_batch_size: 1
- eval_batch_size: 1
- seed: 42
- gradient_accumulation_steps: 2
- total_train_batch_size: 2
- optimizer: Use adamw_torch with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: cosine
- lr_scheduler_warmup_ratio: 0.1
- num_epochs: 1.0
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 0.6055 | 0.0335 | 500 | 0.5799 |
| 0.6442 | 0.0669 | 1000 | 0.5864 |
| 0.5074 | 0.1004 | 1500 | 0.6054 |
| 0.6184 | 0.1339 | 2000 | 0.5991 |
| 0.6338 | 0.1674 | 2500 | 0.5784 |
| 0.6266 | 0.2008 | 3000 | 0.5759 |
| 0.4934 | 0.2343 | 3500 | 0.5649 |
| 0.5326 | 0.2678 | 4000 | 0.5536 |
| 0.5324 | 0.3012 | 4500 | 0.5437 |
| 0.6128 | 0.3347 | 5000 | 0.5311 |
| 0.6001 | 0.3682 | 5500 | 0.5204 |
| 0.5169 | 0.4016 | 6000 | 0.5109 |
| 0.5012 | 0.4351 | 6500 | 0.5014 |
| 0.5338 | 0.4686 | 7000 | 0.4935 |
| 0.5349 | 0.5021 | 7500 | 0.4793 |
| 0.5438 | 0.5355 | 8000 | 0.4699 |
| 0.4265 | 0.5690 | 8500 | 0.4599 |
| 0.4636 | 0.6025 | 9000 | 0.4497 |
| 0.481 | 0.6359 | 9500 | 0.4415 |
| 0.5104 | 0.6694 | 10000 | 0.4336 |
| 0.4597 | 0.7029 | 10500 | 0.4261 |
| 0.483 | 0.7364 | 11000 | 0.4191 |
| 0.417 | 0.7698 | 11500 | 0.4121 |
| 0.4537 | 0.8033 | 12000 | 0.4075 |
| 0.3964 | 0.8368 | 12500 | 0.4028 |
| 0.4793 | 0.8702 | 13000 | 0.3999 |
| 0.489 | 0.9037 | 13500 | 0.3980 |
| 0.3901 | 0.9372 | 14000 | 0.3970 |
| 0.4054 | 0.9706 | 14500 | 0.3965 |
Framework versions
- Transformers 4.46.1
- Pytorch 2.5.1+cu124
- Datasets 3.1.0
- Tokenizers 0.20.3
- Downloads last month
- -