ogulcanaydogan commited on
Commit
23f6259
·
verified ·
1 Parent(s): b925fbb

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +93 -71
README.md CHANGED
@@ -8,43 +8,56 @@ tags:
8
  - instruct
9
  - conversational
10
  - chatbot
11
- - türkçe
12
  - text-generation
13
  base_model: TURKCELL/Turkcell-LLM-7b-v1
14
  pipeline_tag: text-generation
15
  library_name: transformers
16
  ---
17
 
18
- # Turkish-LLM-7B-Instruct 🇹🇷
19
 
20
  The first open-source instruction-tuned Turkish language model at 7B scale.
21
 
22
- [![Model on HF](https://huggingface.co/datasets/huggingface/badges/resolve/main/model-on-hf-md.svg)](https://huggingface.co/ogulcanaydogan/turkish-llm-7b-instruct)
 
 
 
 
 
 
23
 
24
  ## Highlights
25
 
26
- - 🇹🇷 **Native Turkish** - Trained specifically for Turkish language tasks
27
- - 💬 **Instruction Following** - Optimized for chat and Q&A
28
- - 🚀 **7B Parameters** - Balanced performance and efficiency
29
- - 📖 **Open Source** - Apache 2.0 License
30
 
31
  ## Model Details
32
 
33
- | | |
34
- |---|---|
 
35
  | **Base Model** | [TURKCELL/Turkcell-LLM-7b-v1](https://huggingface.co/TURKCELL/Turkcell-LLM-7b-v1) |
36
  | **Parameters** | 7 Billion |
37
- | **Language** | Turkish (Türkçe) |
38
  | **License** | Apache 2.0 |
39
- | **Training Data** | 125,000+ Turkish instruction-response pairs |
40
  | **Fine-tuning** | LoRA (Low-Rank Adaptation) |
 
 
 
 
 
 
 
 
 
41
 
42
  ## Training
43
 
44
  | Parameter | Value |
45
  |-----------|-------|
46
  | Hardware | NVIDIA A100 80GB |
47
- | Training Time | ~10 hours |
48
  | Framework | PyTorch + Transformers + PEFT |
49
  | Precision | bfloat16 |
50
  | Final Loss | 1.88 |
@@ -54,80 +67,92 @@ The first open-source instruction-tuned Turkish language model at 7B scale.
54
  | LoRA Rank | 64 |
55
  | LoRA Alpha | 128 |
56
 
57
- ## Quick Start
 
 
58
 
59
  ```python
60
  from transformers import AutoModelForCausalLM, AutoTokenizer
61
  import torch
62
 
63
- # Load model
64
  model = AutoModelForCausalLM.from_pretrained(
65
- "ogulcanaydogan/turkish-llm-7b-instruct",
66
  torch_dtype=torch.bfloat16,
67
  device_map="auto"
68
  )
69
- tokenizer = AutoTokenizer.from_pretrained("ogulcanaydogan/turkish-llm-7b-instruct")
70
-
71
- # Chat format
72
- def chat(message):
73
- prompt = f"<|im_start|>user\n{message}<|im_end|>\n<|im_start|>assistant\n"
74
- inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
75
- outputs = model.generate(
76
- **inputs,
77
- max_new_tokens=512,
78
- temperature=0.7,
79
- top_p=0.9,
80
- do_sample=True
81
- )
82
- return tokenizer.decode(outputs[0], skip_special_tokens=True).split("assistant\n")[-1]
83
-
84
- # Example
85
- print(chat("Türkiye'nin başkenti neresidir?"))
86
  ```
87
 
88
- ## Example Outputs
 
 
 
 
 
 
89
 
90
- ### Question Answering
91
- | Soru | Cevap |
92
- |------|-------|
93
- | Türkiye'nin başkenti neresidir? | Türkiye'nin başkenti Ankara'dır. |
94
- | Yapay zeka nedir? | Yapay zeka, öğrenme ve akıl yürütme yeteneğine sahip bilgisayar sistemlerini ifade eder. |
 
 
 
95
 
96
- ### Creative Writing
97
- **Prompt:** Bana kısa bir hikaye yaz.
98
 
99
- **Response:** Bir varmış bir yokmuş, çok uzak bir diyarda, büyük bir maceraya atılan bir grup arkadaş varmış. Hepsi cesur ve cesurdu ve birbirlerine yardım etmek için her zaman hazırdı...
 
100
 
101
- ### Code Generation
102
- **Prompt:** Python'da bir listeyi nasıl sıralarım?
103
 
104
- **Response:** Python'da bir listeyi sıralamanın birkaç yolu vardır. Yaygın yöntemlerden biri sorted() işlevini kullanmaktır...
 
 
 
 
105
 
106
- ## Use Cases
107
 
108
- - 🤖 Turkish chatbots and virtual assistants
109
- - Question answering systems
110
- - 📝 Text generation and creative writing
111
- - 📚 Educational applications
112
- - 🔬 NLP research for Turkish language
113
 
114
  ## Limitations
115
 
116
  - May occasionally generate incorrect information (hallucinations)
117
- - Code generation sometimes uses Turkish keywords instead of English
118
  - Performance on very long contexts (>2048 tokens) may degrade
119
  - Not recommended for production without additional safety measures
120
 
121
- ## Author
122
 
123
- **Ogulcan Aydogan**
124
-
125
- | | |
126
- |---|---|
127
- | 🌐 Website | [ogulcanaydogan.com](https://ogulcanaydogan.com) |
128
- | 🐙 GitHub | [github.com/ogulcanaydogan](https://github.com/ogulcanaydogan) |
129
- | 🤗 HuggingFace | [huggingface.co/ogulcanaydogan](https://huggingface.co/ogulcanaydogan) |
130
- | 💼 LinkedIn | [linkedin.com/in/ogulcanaydogan](https://linkedin.com/in/ogulcanaydogan) |
131
 
132
  ## Citation
133
 
@@ -137,22 +162,19 @@ print(chat("Türkiye'nin başkenti neresidir?"))
137
  title = {Turkish-LLM-7B-Instruct: An Instruction-Tuned Turkish Language Model},
138
  year = {2026},
139
  publisher = {HuggingFace},
140
- url = {https://huggingface.co/ogulcanaydogan/turkish-llm-7b-instruct}
141
  }
142
  ```
143
 
 
 
 
 
 
 
 
144
  ## Acknowledgments
145
 
146
  - Base model by [TURKCELL](https://huggingface.co/TURKCELL)
147
  - Training framework: [HuggingFace Transformers](https://github.com/huggingface/transformers)
148
  - Fine-tuning: [PEFT](https://github.com/huggingface/peft)
149
-
150
- ---
151
-
152
- <p align="center">
153
- <b>If you find this model useful, please ⭐ star the repository!</b>
154
- </p>
155
-
156
- <p align="center">
157
- Made with ❤️ in Turkey 🇹🇷
158
- </p>
 
8
  - instruct
9
  - conversational
10
  - chatbot
 
11
  - text-generation
12
  base_model: TURKCELL/Turkcell-LLM-7b-v1
13
  pipeline_tag: text-generation
14
  library_name: transformers
15
  ---
16
 
17
+ # Turkish-LLM-7B-Instruct
18
 
19
  The first open-source instruction-tuned Turkish language model at 7B scale.
20
 
21
+ <p align="center">
22
+ <a href="https://huggingface.co/spaces/ogulcanaydogan/Turkish-LLM-7B-Chat"><img src="https://img.shields.io/badge/Demo-Live_Chat-blue?style=for-the-badge&logo=huggingface" alt="Demo"></a>
23
+ <a href="https://github.com/ogulcanaydogan/Turkish-LLM"><img src="https://img.shields.io/badge/GitHub-Repository-black?style=for-the-badge&logo=github" alt="GitHub"></a>
24
+ <a href="https://huggingface.co/ogulcanaydogan/Turkish-LLM-14B-Instruct"><img src="https://img.shields.io/badge/Also_Available-14B_Model-yellow?style=for-the-badge&logo=huggingface" alt="14B"></a>
25
+ </p>
26
+
27
+ ---
28
 
29
  ## Highlights
30
 
31
+ - **Native Turkish** - Trained specifically for Turkish language tasks
32
+ - **Instruction Following** - Optimized for chat and Q&A
33
+ - **7B Parameters** - Balanced performance and efficiency
34
+ - **Open Source** - Apache 2.0 License
35
 
36
  ## Model Details
37
 
38
+ | Attribute | Value |
39
+ |-----------|-------|
40
+ | **Developer** | [Ogulcan Aydogan](https://ogulcanaydogan.com) |
41
  | **Base Model** | [TURKCELL/Turkcell-LLM-7b-v1](https://huggingface.co/TURKCELL/Turkcell-LLM-7b-v1) |
42
  | **Parameters** | 7 Billion |
43
+ | **Language** | Turkish (tr) |
44
  | **License** | Apache 2.0 |
 
45
  | **Fine-tuning** | LoRA (Low-Rank Adaptation) |
46
+ | **Training Data** | 125,000+ Turkish instruction-response pairs |
47
+
48
+ ### Model Family
49
+
50
+ | Model | Parameters | Base | Method | Use Case |
51
+ |-------|-----------|------|--------|----------|
52
+ | [Turkish-LLM-14B-Instruct](https://huggingface.co/ogulcanaydogan/Turkish-LLM-14B-Instruct) | 14.7B | Qwen2.5-14B-Instruct | SFT | Higher quality, complex reasoning |
53
+ | [Turkish-LLM-14B-Instruct-GGUF](https://huggingface.co/ogulcanaydogan/Turkish-LLM-14B-Instruct-GGUF) | 14.7B | 14B-Instruct | GGUF quantized | Local/edge deployment |
54
+ | **Turkish-LLM-7B-Instruct** (this) | 7B | Turkcell-LLM-7b-v1 | LoRA | Lightweight, faster inference |
55
 
56
  ## Training
57
 
58
  | Parameter | Value |
59
  |-----------|-------|
60
  | Hardware | NVIDIA A100 80GB |
 
61
  | Framework | PyTorch + Transformers + PEFT |
62
  | Precision | bfloat16 |
63
  | Final Loss | 1.88 |
 
67
  | LoRA Rank | 64 |
68
  | LoRA Alpha | 128 |
69
 
70
+ ## Usage
71
+
72
+ ### Transformers
73
 
74
  ```python
75
  from transformers import AutoModelForCausalLM, AutoTokenizer
76
  import torch
77
 
 
78
  model = AutoModelForCausalLM.from_pretrained(
79
+ "ogulcanaydogan/Turkish-LLM-7B-Instruct",
80
  torch_dtype=torch.bfloat16,
81
  device_map="auto"
82
  )
83
+ tokenizer = AutoTokenizer.from_pretrained("ogulcanaydogan/Turkish-LLM-7B-Instruct")
84
+
85
+ messages = [
86
+ {"role": "user", "content": "Turkiye'nin baskenti neresidir?"}
87
+ ]
88
+
89
+ prompt = "<|im_start|>user\n" + messages[0]["content"] + "<|im_end|>\n<|im_start|>assistant\n"
90
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
91
+ outputs = model.generate(
92
+ **inputs,
93
+ max_new_tokens=512,
94
+ temperature=0.7,
95
+ top_p=0.9,
96
+ do_sample=True
97
+ )
98
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True).split("assistant\n")[-1])
 
99
  ```
100
 
101
+ ### Ollama
102
+
103
+ ```bash
104
+ ollama run hf.co/ogulcanaydogan/Turkish-LLM-7B-Instruct
105
+ ```
106
+
107
+ ### Chat Template
108
 
109
+ ```
110
+ <|im_start|>user
111
+ {user_message}<|im_end|>
112
+ <|im_start|>assistant
113
+ {assistant_response}<|im_end|>
114
+ ```
115
+
116
+ ## Example Outputs
117
 
118
+ **Q:** Turkiye'nin baskenti neresidir?
119
+ **A:** Turkiye'nin baskenti Ankara'dir.
120
 
121
+ **Q:** Yapay zeka nedir?
122
+ **A:** Yapay zeka, ogrenme ve akil yurutme yetenegine sahip bilgisayar sistemlerini ifade eder.
123
 
124
+ ## Hardware Requirements
 
125
 
126
+ | Precision | VRAM Required | Recommended |
127
+ |-----------|--------------|-------------|
128
+ | BF16 | ~14 GB | RTX 4090, A10G, M2 Pro (16GB) |
129
+ | INT8 | ~7 GB | RTX 3080, M1 Pro |
130
+ | INT4 | ~4 GB | RTX 3060, Apple M-series (8GB) |
131
 
132
+ ## Intended Use
133
 
134
+ - Turkish chatbots and virtual assistants
135
+ - Question answering systems
136
+ - Text generation and creative writing
137
+ - Educational applications
138
+ - NLP research for Turkish language
139
 
140
  ## Limitations
141
 
142
  - May occasionally generate incorrect information (hallucinations)
 
143
  - Performance on very long contexts (>2048 tokens) may degrade
144
  - Not recommended for production without additional safety measures
145
 
146
+ ## Related Resources
147
 
148
+ | Resource | Link |
149
+ |----------|------|
150
+ | 14B Model | [Turkish-LLM-14B-Instruct](https://huggingface.co/ogulcanaydogan/Turkish-LLM-14B-Instruct) |
151
+ | 14B GGUF | [Turkish-LLM-14B-Instruct-GGUF](https://huggingface.co/ogulcanaydogan/Turkish-LLM-14B-Instruct-GGUF) |
152
+ | Live Demo (14B) | [Turkish-LLM-14B-Chat](https://huggingface.co/spaces/ogulcanaydogan/Turkish-LLM-14B-Chat) |
153
+ | Live Demo (7B) | [Turkish-LLM-7B-Chat](https://huggingface.co/spaces/ogulcanaydogan/Turkish-LLM-7B-Chat) |
154
+ | Training Pipeline | [LowResource-LLM-Forge](https://github.com/ogulcanaydogan/LowResource-LLM-Forge) |
155
+ | Project Repository | [Turkish-LLM on GitHub](https://github.com/ogulcanaydogan/Turkish-LLM) |
156
 
157
  ## Citation
158
 
 
162
  title = {Turkish-LLM-7B-Instruct: An Instruction-Tuned Turkish Language Model},
163
  year = {2026},
164
  publisher = {HuggingFace},
165
+ url = {https://huggingface.co/ogulcanaydogan/Turkish-LLM-7B-Instruct}
166
  }
167
  ```
168
 
169
+ ## Contact
170
+
171
+ - Website: [ogulcanaydogan.com](https://ogulcanaydogan.com)
172
+ - GitHub: [github.com/ogulcanaydogan](https://github.com/ogulcanaydogan)
173
+ - Hugging Face: [huggingface.co/ogulcanaydogan](https://huggingface.co/ogulcanaydogan)
174
+ - LinkedIn: [linkedin.com/in/ogulcanaydogan](https://linkedin.com/in/ogulcanaydogan)
175
+
176
  ## Acknowledgments
177
 
178
  - Base model by [TURKCELL](https://huggingface.co/TURKCELL)
179
  - Training framework: [HuggingFace Transformers](https://github.com/huggingface/transformers)
180
  - Fine-tuning: [PEFT](https://github.com/huggingface/peft)