gemma-2b-tr fine-tuned with Turkish Instruction-Response pairs.
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.
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
1from transformers import AutoTokenizer, AutoModelForCausalLM
2
3tokenizer = AutoTokenizer.from_pretrained("Metin/gemma-2b-tr-inst")
4model = AutoModelForCausalLM.from_pretrained("Metin/gemma-2b-tr-inst")
5
6system_prompt = "You are a helpful assistant. Always reply in Turkish."
7instruction = "Ankara hangi ülkenin başkentidir?"
8prompt = f"{system_prompt} [INST] {instruction} [/INST]"
9input_ids = tokenizer(prompt, return_tensors="pt")
10
11outputs = model.generate(**input_ids)
12print(tokenizer.decode(outputs[0]))
As it can be seen from the above example instructions should be framed within the following structure: