File size: 3,254 Bytes
7b91297
 
 
 
 
 
3384eb1
 
 
7b91297
 
3384eb1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7b91297
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
license: apache-2.0
---

<h1 style="text-align: center;">TKK-LLaMA3-8B-Elite-V1.0</h1>

<p style="text-align: center;">
    TKK-LLaMA3-8B-Elite-V1.0, a generative model built upon the LLaMA 8B architecture, represents my individual undergraduate graduation project. Developed during my studies in Software Engineering at Malatya Turgut Özal University, this project stands as a culmination of my academic endeavors. I extend my sincere appreciation to Assoc. Prof. Dr. Harun Bingöl, who served as both my department chair and thesis advisor. His invaluable guidance, unwavering support, and mentorship have significantly shaped my educational and research experiences. I am deeply grateful for his continuous encouragement, insightful feedback, and unwavering dedication. Thank you, Dr. Bingöl...
</p>


![image/png](https://cdn-uploads.huggingface.co/production/uploads/62bdd8065f304e8ea762287f/yjhKqN_bkVuJRa7JMtMBW.png) 



<h2>Model Details</h2>

<p>
    Training took 133 hours and 59 minutes for a total of 37,420 steps and was conducted on 8 Tesla V100 GPUs.
</p>


<ul>
    <li><strong>Base Model:</strong> LLaMA 8B based LLM</li>
    <li><strong>Model Developers:</strong> Tarık Kaan Koç</li>
    <li><strong>Thesis Advisor:</strong> Assoc. Prof. Dr. Harun Bingöl</li>
    <li><strong>Input:</strong> Text only</li>
    <li><strong>Output:</strong> Text only</li>
    <li><strong>Training Dataset:</strong> Cleaned Turkish raw data with 1 million raw instruction Turkish data, private</li>
    <li><strong>Training Method:</strong> Fine-tuning with LORA</li>
</ul>

<h2>LORA Fine-Tuning Configuration</h2>


![image/png](https://cdn-uploads.huggingface.co/production/uploads/62bdd8065f304e8ea762287f/TYPXlGYUilOJ5fsQDK9-O.png)

<ul>
    <li><strong>lora_alpha:</strong> 16</li>
    <li><strong>lora_dropout:</strong> 0.1</li>
    <li><strong>r:</strong> 64</li>
    <li><strong>bias:</strong> none</li>
    <li><strong>task_type:</strong> CAUSAL_LM</li>
</ul>



### Example Usage:

```python
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer, pipeline
import torch

model_id = "tarikkaankoc7/TKK-LLaMA3-8B-Elite-V1.0"

model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
    trust_remote_code=True
)

tokenizer = AutoTokenizer.from_pretrained(
    model_id,
    trust_remote_code=True
)

streamer = TextStreamer(tokenizer)

text_generation_pipeline = pipeline(
    "text-generation",
    model=model,
    tokenizer=tokenizer,
    model_kwargs={"torch_dtype": torch.bfloat16},
    streamer=streamer
)

messages = [
    {"role": "system", "content": "Sen yardımsever bir yapay zeka asistanısın ve kullanıcıların verdiği talimatlara doğrultusunda en iyi cevabı üretmeye çalışıyorsun."},
    {"role": "user", "content": "Leonardo da Vinci'nin en ünlü tablosu hangisidir?"}
]

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

terminators = [
    tokenizer.eos_token_id
]

outputs = text_generation_pipeline(
    prompt,
    max_new_tokens=2048,
    eos_token_id=terminators,
    do_sample=True,
    temperature=0.6,
    top_p=0.95
)

print(outputs[0]["generated_text"])
```