Instructions to use Metin/LLaMA-3-8B-Instruct-TR-DPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Metin/LLaMA-3-8B-Instruct-TR-DPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Metin/LLaMA-3-8B-Instruct-TR-DPO") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Metin/LLaMA-3-8B-Instruct-TR-DPO") model = AutoModelForCausalLM.from_pretrained("Metin/LLaMA-3-8B-Instruct-TR-DPO", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Metin/LLaMA-3-8B-Instruct-TR-DPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Metin/LLaMA-3-8B-Instruct-TR-DPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Metin/LLaMA-3-8B-Instruct-TR-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Metin/LLaMA-3-8B-Instruct-TR-DPO
- SGLang
How to use Metin/LLaMA-3-8B-Instruct-TR-DPO 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/LLaMA-3-8B-Instruct-TR-DPO" \ --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": "Metin/LLaMA-3-8B-Instruct-TR-DPO", "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 "Metin/LLaMA-3-8B-Instruct-TR-DPO" \ --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": "Metin/LLaMA-3-8B-Instruct-TR-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Metin/LLaMA-3-8B-Instruct-TR-DPO with Docker Model Runner:
docker model run hf.co/Metin/LLaMA-3-8B-Instruct-TR-DPO

LLaMA-3-8B-Instruct-TR-DPO
LLaMA-3-8B-Instruct-TR-DPO is a finetuned version of Meta-LLaMA-3-8B-Instruct, which has been trained on a preference dataset generated synthetically.
Training Info
Base Model: Meta-LLaMA-3-8B-Instruct
Training Data: A synthetically generated preference dataset consisting of 10K samples was used. No proprietary data was utilized.
Training Time: 3 hours on a single RTX 6000 Ada
QLoRA Configs:
- lora_r: 64
- lora_alpha: 32
- lora_dropout: 0.05
- lora_target_linear: true
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, LLaMA-3-8B-Instruct-TR-DPO 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.
How to use
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/LLaMA-3-8B-Instruct-TR-DPO"
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
model_kwargs={"torch_dtype": torch.bfloat16 ,'quantization_config': bnb_config},
device_map="auto",
)
messages = [
{"role": "system", "content": "You are a helpful assistant. Always reply in Turkish."},
{"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):])
OpenLLMTurkishLeaderboard_v0.2 benchmark results
- MMLU_TR_V0.2: 49.83%
- Truthful_QA_TR_V0.2: 52.32%
- ARC_TR_V0.2: 44.37%
- HellaSwag_TR_V0.2: 45.58%
- GSM8K_TR_V0.2: 54.21%
- Winogrande_TR_V0.2: 55.06%
- Average: 50.22%
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.)
Output Example (DPO Model vs Base Model)
Testing the model with a single example is not an accurate method. However, an example is provided here to showcase the model's capabilities.
Model: LLaMA-3-8B-Instruct-TR-DPO
Input
Yeni bir derin รถฤrenme modelinin tanฤฑtฤฑmฤฑ iรงin bir etkinlik planฤฑ hazฤฑrla.
Output
Harika bir fikir!
Etkinlik Planฤฑ: "Deep Learning Modeli Tanฤฑtฤฑmฤฑ"
**Adฤฑm 1: รn-Baลlangฤฑรง**
* Konuลma konusu: "Deep Learning Modeli Tanฤฑtฤฑmฤฑ"
* Katฤฑlฤฑmcฤฑ profili: Bilimsel ve teknoloji odaklฤฑ profesyoneller, รถฤrenciler ve araลtฤฑrmacฤฑlar
* Etkinlik sรผresi: 2 saat
**Adฤฑm 2: Giriล**
* Sunum: "Deep Learning Modeli Tanฤฑtฤฑmฤฑ: Tarihรงesi ve Temelleri"
* Sunum iรงeriฤi: Deep learning modelinin tarihi, temel kavramlarฤฑ (รถrneฤin, ANN, CNN, RNN), uygulamalarฤฑ ve avantajlarฤฑ
* Sunum sรผresi: 30 dakika
**Adฤฑm 3: Modelin รalฤฑลma รrnekleri**
* Sunum: "Deep Learning Modelinin รalฤฑลma รrnekleri"
* Sunum iรงeriฤi: Modelin uygulamalarฤฑ (รถrneฤin, gรถrรผntรผ sฤฑnฤฑflandฤฑrma, doฤal dil iลleme, makine รถฤrenimi)
* Sunum sรผresi: 45 dakika
**Adฤฑm 4: Katฤฑlฤฑmcฤฑ Sorularฤฑ ve Tartฤฑลma**
* Katฤฑlฤฑmcฤฑ sorularฤฑna cevap verme
* Tartฤฑลma: Modelin avantajlarฤฑ ve dezavantajlarฤฑ, uygulamalarฤฑ ve gelecekteki geliลmeleri
**Adฤฑm 5: Sonuรง**
* Sunum: "Deep Learning Modelinin Sonuรงlarฤฑ"
* Sunum iรงeriฤi: Modelin sonuรงlarฤฑ, uygulamalarฤฑ ve gelecekteki geliลmeleri
* Sunum sรผresi: 15 dakika
**Etkinlik Notlarฤฑ**
* Sunumlar ve tartฤฑลmalar iรงin gerekli malzemeleri hazฤฑrlayฤฑn
* Katฤฑlฤฑmcฤฑlarฤฑn sorularฤฑna cevap verme iรงin yeterli zaman ayฤฑrฤฑn
* Etkinlik sonrasฤฑ katฤฑlฤฑmcฤฑlarฤฑn geri bildirimlerini alฤฑn
Umarฤฑm bu etkinlik planฤฑ sizin iรงin yardฤฑmcฤฑ olur!
Model: LLaMA-3-8B-Instruct
Input
Harika bir fikir! Aลaฤฤฑdaki etkinlik planฤฑnฤฑ hazฤฑrladฤฑm:
**Etkinlik Adฤฑ:** "Derin รฤrenme Modelinin Tanฤฑtฤฑmฤฑ"
**Etkinlik Amacฤฑ:** Derin รถฤrenme modelinin tanฤฑtฤฑmฤฑ ve uygulamalarฤฑ hakkฤฑnda bilgi sahibi olmak.
**Etkinlik Planฤฑ:**
1. **Giriล:** Derin รถฤrenme modelinin tanฤฑtฤฑmฤฑ ve รถnemi hakkฤฑnda kฤฑsa bir konuลma.
2. **Teorik Bรถlรผm:** Derin รถฤrenme modelinin teorik temelleri ve รงalฤฑลma prensipleri hakkฤฑnda sunum.
3. **Uygulama Bรถlรผm:** Derin รถฤrenme modelinin uygulamalarฤฑ ve baลarฤฑlarฤฑ hakkฤฑnda sunum.
4. **Pratik Bรถlรผm:** Derin รถฤrenme modelinin pratik uygulamalarฤฑ ve deneyimi hakkฤฑnda sunum.
5. **Soru-Cevap Bรถlรผm:** Derin รถฤrenme modelinin sorularฤฑna cevap verme.
6. **Sonuรง Bรถlรผm:** Derin รถฤrenme modelinin tanฤฑtฤฑmฤฑ ve uygulamalarฤฑ hakkฤฑnda sonuรง ve tavsiye.
**Etkinlik Malzemeleri:**
* Sunum araรงlarฤฑ (slaj, powerpoint, vs.)
* Derin รถฤrenme modelinin uygulamalarฤฑ hakkฤฑnda รถrnekler ve grafikler
* Derin รถฤrenme modelinin teorik temelleri hakkฤฑnda kitap ve makaleler
* Derin รถฤrenme modelinin pratik uygulamalarฤฑ hakkฤฑnda deneyimi hakkฤฑnda sunum
**Etkinlik Sรผresi:** 2 saat
**Katฤฑlฤฑmcฤฑ Sayฤฑsฤฑ:** 20-30 kiลi
**Etkinlik Yeri:** Bilimsel toplantฤฑ salonu veya online platform
**Etkinlik Tarih ve Saati:** 10:00-12:00
**Etkinlik Dili:** Tรผrkรงe
**Etkinlik Katฤฑlฤฑmcฤฑlarฤฑ:** Bilimsel toplantฤฑ salonunda veya online platformda katฤฑlฤฑmcฤฑlar.
**Etkinlik Sonuรงlarฤฑ:** Derin รถฤrenme modelinin tanฤฑtฤฑmฤฑ ve uygulamalarฤฑ hakkฤฑnda bilgi sahibi olmak.
**Etkinlik Tavsiyesi:** Derin รถฤrenme modelinin tanฤฑtฤฑmฤฑ ve uygulamalarฤฑ hakkฤฑnda bilgi sahibi olmak.
- Downloads last month
- 27
Model tree for Metin/LLaMA-3-8B-Instruct-TR-DPO
Evaluation results
- 5-shot on MMLU_TR_V0.2self-reported0.498
- 0-shot on Truthful_QA_V0.2self-reported0.523
- 25-shot on ARC_TR_V0.2self-reported0.444
- 10-shot on HellaSwag_TR_V0.2self-reported0.456
- 5-shot on GSM8K_TR_V0.2self-reported0.542
- 5-shot on Winogrande_TR_V0.2self-reported0.551