Views
No views yet
AutoModelForCausalLM.trust_remote_code=True.| Property | Value |
|---|---|
| Model name | Nafie-473M |
| Repository | nafie-ai/nafie-473M |
| Architecture | Custom decoder-only causal LM |
| Primary language | Turkish |
| Layers | 36 |
| Hidden size | 1024 |
| Attention heads | 4 |
| Context length | 1024 tokens |
| Tokenizer | Custom BPE tokenizer |
| License | Apache-2.0 |
| Framework | PyTorch + Hugging Face Transformers |
| Model | MCQA | NLI | QA | TC |
|---|---|---|---|---|
| Nafie-473M | 44.22 | 36.34 | 0.42 | 38.38 |
Kumru-7B | 57.64 | 37.42 | 16.30 | 63.39 |
Llama-3.3-70B-Instruct | 60.70 | 37.10 | 23.97 | 63.73 |
Kumru-2B | 39.69 | 37.97 | 6.50 | 47.57 |
Trendyol/Llama-3-Trendyol-LLM-8b-chat-v2.0 | 53.28 | 37.29 | 0.17 | 54.06 |
Trendyol/Trendyol-LLM-7b-chat-v4.1.0 | 54.94 | 35.71 | 0.34 | 52.12 |
google/gemma-3-27b-it | 55.40 | 36.73 | 10.56 | 53.65 |
google/gemma-3-12b-it | 52.66 | 34.93 | 10.26 | 54.38 |
Qwen/Qwen2-72B-Instruct | 61.27 | 35.59 | 0.83 | 60.47 |
CohereLabs/aya-expanse-32b | 52.47 | 35.93 | 0.67 | 50.67 |
CohereLabs/aya-expanse-8b | 44.09 | 37.12 | 0.19 | 50.03 |
google/gemma-3-4b-it | 42.33 | 31.11 | 8.22 | 46.15 |
ytu-ce-cosmos/Turkish-Gemma-9b-v0.1 | 51.85 | 32.68 | 0.11 | 46.97 |
meta-llama/Llama-3.2-11B-Vision-Instruct | 45.66 | 37.49 | 4.37 | 47.88 |
meta-llama/Llama-3.1-8B-Instruct | 45.77 | 38.99 | 3.30 | 46.51 |
google/gemma-2-9b-it | 48.20 | 35.76 | 0.46 | 45.38 |
ytu-ce-cosmos/turkish-gpt2-large-750m-instruct-v0.1 | 35.20 | 37.60 | 0.28 | 52.77 |
Qwen/Qwen2-7B-Instruct | 49.66 | 35.33 | 1.53 | 52.52 |
meta-llama/Llama-3.2-3B-Instruct | 37.00 | 33.25 | 7.52 | 39.00 |
pip install -U "transformers[torch]" huggingface_hub safetensors1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4repo_id = "nafie-ai/nafie-473M"
5
6tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
7model = AutoModelForCausalLM.from_pretrained(
8 repo_id,
9 trust_remote_code=True,
10 dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
11 device_map="auto",
12)
13
14prompt = "<s>Türkiye'nin başkenti neresidir?</s>"
15inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
16
17outputs = model.generate(
18 **inputs,
19 max_new_tokens=128,
20 do_sample=True,
21 temperature=0.3,
22 top_k=3,
23 top_p=0.95,
24 repetition_penalty=1.2,
25)
26generated_ids = outputs[0][inputs["input_ids"].shape[-1]:]
27print(tokenizer.decode(generated_ids, skip_special_tokens=True).strip())1from transformers import pipeline
2
3generator = pipeline(
4 "text-generation",
5 model="nafie-ai/nafie-473M",
6 trust_remote_code=True,
7 device_map="auto",
8)
9
10generator(
11 "<s>Türkçe dil modelleri ne işe yarar?</s>",
12 max_new_tokens=128,
13 do_sample=True,
14 temperature=0.3,
15 top_k=3,
16 top_p=0.95,
17 repetition_penalty=1.2,
18)1{
2 "max_new_tokens": 700,
3 "do_sample": True,
4 "temperature": 0.3,
5 "top_k": 3,
6 "top_p": 0.95,
7 "repetition_penalty": 1.2,
8}nafie-ai/nafie-sft-v1LICENSE file for the full license text.1Nafie: A Lightweight Turkish Causal Language Model.
2https://huggingface.co/nafie-ai/nafie-473M1Nafie SFT v1: A Turkish supervised fine-tuning dataset for reasoning, instruction following, anti-hallucination, and text-grounded QA.
2https://huggingface.co/datasets/nafie-ai/nafie-sft-v1