Downloads · 30 days
45
0% of all-time downloads
Metin/Gemma-2-9b-it-TR-DPO-V1
Gemma-2-9b-it-TR-DPO-V1 is a text generation model from Metin. Use it when you need the model to write or continue text. The card lists the license as gemma.
<img src="https://huggingface.co/Metin/Gemma-2-9b-it-TR-DPO-V1/resolve/main/gemma29bitdpotrv1.png" alt="Logo of Gemma and country code 'TR' in the bottom right corner" width="420"/
Downloads · 30 days
45
0% of all-time downloads
All-time downloads
38.2K
Public
Parameters
9.2B
18.5 GB on disk
Likes
15
Public
Click a slice to open those files.
.safetensors18.5 GB · 100%
From the Hugging Face model README
<img src="https://huggingface.co/Metin/Gemma-2-9b-it-TR-DPO-V1/resolve/main/gemma2_9b_it_dpo_tr_v1.png" alt="Logo of Gemma and country code 'TR' in the bottom right corner" width="420"/>
Gemma-2-9b-it-TR-DPO-V1 is a finetuned version of gemma-2-9b-it. It is trained on a preference dataset which is generated synthetically.
Base Model: gemma-2-9b-it
Training Data: A synthetically generated preference dataset consisting of 10K samples was used. No proprietary data was utilized.
Training Time: 2 hours on a single NVIDIA H100
QLoRA Configs:
The aim was to finetune the model to enhance the output format and content quality for the Turkish language. It is not necessarily smarter than the base model, but its outputs are more likable and preferable.
Compared to the base model, Gemma-2-9b-it-TR-DPO-V1 is more fluent and coherent in Turkish. It can generate more informative and detailed answers for a given instruction.
It should be noted that the model will still generate incorrect or nonsensical outputs, so please verify the outputs before using them.
You can use the below code snippet to use the model:
from transformers import BitsAndBytesConfig
import transformers
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 = "Metin/Gemma-2-9b-it-TR-DPO-V1"
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
model_kwargs={"torch_dtype": torch.bfloat16 ,'quantization_config': bnb_config},
device_map="auto",
)
messages = [
{"role": "user", "content": "Python'da bir öğenin bir listede geçip geçmediğini nasıl kontrol edebilirim?"},
]
prompt = pipeline.tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
terminators = [
pipeline.tokenizer.eos_token_id,
pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
]
outputs = pipeline(
prompt,
max_new_tokens=512,
eos_token_id=terminators,
do_sample=True,
temperature=0.2,
top_p=0.9,
)
print(outputs[0]["generated_text"][len(prompt):])
These scores may differ from what you will get when you run the same benchmarks, as I did not use any inference engine (vLLM, TensorRT-LLM, etc.)
@article{Metin,
title={Metin/Gemma-2-9b-it-TR-DPO-V1},
author={Metin Usta},
year={2024},
url={https://huggingface.co/Metin/Gemma-2-9b-it-TR-DPO-V1}
}