Instructions to use Metin/gemma-2b-tr-inst with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Metin/gemma-2b-tr-inst with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Metin/gemma-2b-tr-inst")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Metin/gemma-2b-tr-inst") model = AutoModelForCausalLM.from_pretrained("Metin/gemma-2b-tr-inst") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Metin/gemma-2b-tr-inst with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Metin/gemma-2b-tr-inst" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Metin/gemma-2b-tr-inst", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Metin/gemma-2b-tr-inst
- SGLang
How to use Metin/gemma-2b-tr-inst 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 "Metin/gemma-2b-tr-inst" \ --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": "Metin/gemma-2b-tr-inst", "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 "Metin/gemma-2b-tr-inst" \ --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": "Metin/gemma-2b-tr-inst", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Metin/gemma-2b-tr-inst with Docker Model Runner:
docker model run hf.co/Metin/gemma-2b-tr-inst
Model Card for Model ID
gemma-2b-tr fine-tuned with Turkish Instruction-Response pairs.
Model Details
Model Description
- Language(s) (NLP): Turkish, English
- License: Creative Commons Attribution Non Commercial 4.0
- Finetuned from model [optional]: gemma-2b-tr (https://huggingface.co/Metin/gemma-2b-tr)
Uses
The model is designed for Turkish instruction following and question answering. Its current response quality is limited, likely due to the small instruction set and model size. It is not recommended for real-world applications at this stage.
Restrictions
Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms Please refer to the gemma use restrictions before start using the model. https://ai.google.dev/gemma/terms#3.2-use
How to Get Started with the Model
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Metin/gemma-2b-tr-inst")
model = AutoModelForCausalLM.from_pretrained("Metin/gemma-2b-tr-inst")
system_prompt = "You are a helpful assistant. Always reply in Turkish."
instruction = "Ankara hangi ülkenin başkentidir?"
prompt = f"{system_prompt} [INST] {instruction} [/INST]"
input_ids = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**input_ids)
print(tokenizer.decode(outputs[0]))
As it can be seen from the above example instructions should be framed within the following structure:
SYSTEM_PROMPT [INST] <Your instruction here> [/INST]
Training Details
Training Data
- Dataset: Turkish instructions from the Aya dataset (https://huggingface.co/datasets/CohereForAI/aya_dataset)
- Dataset size: ~550K Token or ~5K instruction-response pair.
Training Procedure
Training Hyperparameters
- Adapter: QLoRA
- Epochs: 1
- Context length: 1024
- LoRA Rank: 32
- LoRA Alpha: 32
- LoRA Dropout: 0.05
- Downloads last month
- 7