Edit model card

image/png

OrpoGemma-2-9B-TR

OrpoGemma-2-9B-TR is a Turkish fine-tuned version of google/gemma-2-9b-it. It is trained using the ORPO Trainer on a subset of 1500 rows from the dataset selimc/orpo-dpo-mix-TR-20k.

Training Information

  • Base Model: google/gemma-2-9b-it

  • Fine-Tuning Technique: ORPO

  • Training Data: 1500 rows from selimc/orpo-dpo-mix-TR-20k

  • Training Time: 2.5 hours on NVIDIA H100

    QLoRA Configurations:

    • lora_r: 16
    • lora_alpha: 32
    • lora_dropout: 0.05

    ORPO Training Parameters

    • lr: 2e-6
    • epochs: 3
    • per_device_train_batch_size: 8
    • gradient_accumulation_steps: 4

πŸ“ˆ Training Curves

image/png

image/png

Model Capabilities

  • Produces fluent, coherent, and contextually appropriate text in Turkish.
  • Delivers detailed and informative responses to a wide range of instructions and question types.
  • May still produce incorrect or nonsensical outputs, user verification is recommended.

How to Use

from transformers import pipeline, BitsAndBytesConfig, AutoTokenizer
import torch

bnb_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_use_double_quant=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype=torch.bfloat16
)

model_id = "selimc/OrpoGemma-2-9B-TR"

tokenizer = AutoTokenizer.from_pretrained(model_id)

pipe = pipeline(
    "text-generation",
    model=model_id,
    model_kwargs={"torch_dtype": torch.bfloat16 ,'quantization_config': bnb_config},
    tokenizer=tokenizer,
    device_map="auto"
)

messages = [
    {"role": "user", "content": "GΓΆkyΓΌzΓΌ neden mavi?"},
]

prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)

outputs = pipe(
    prompt,
    max_new_tokens=512,
    do_sample=True,
    eos_token_id=[pipe.tokenizer.convert_tokens_to_ids("<end_of_turn>"), pipe.tokenizer.eos_token_id],
    temperature=0.67,
)

generated_text = outputs[0]['generated_text']
response = generated_text[len(prompt):].strip()
print(response)
Downloads last month
72
Safetensors
Model size
9.24B params
Tensor type
FP16
Β·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Model tree for selimc/OrpoGemma-2-9B-TR

Base model

google/gemma-2-9b
Finetuned
(70)
this model
Quantizations
1 model

Dataset used to train selimc/OrpoGemma-2-9B-TR