File size: 3,892 Bytes
4147cc4
b42bb85
 
 
 
 
 
 
 
 
 
 
 
4147cc4
 
b42bb85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4147cc4
b42bb85
4147cc4
b42bb85
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
---
license: llama2
base_model: codellama/CodeLlama-13b-hf
tags:
- code
- llama
- turkish
- fine-tuned
- programming
language:
- en
- tr
pipeline_tag: text-generation
---

# 🚀 Code Llama 13B - Turkish Custom Fine-tuned

Bu model, **CodeLlama-13b-hf**'den fine-tune edilmiş özel bir kod üretim modelidir.

## 📊 Training İstatistikleri

- **Base Model**: `codellama/CodeLlama-13b-hf`
- **Training Examples**: 5,544
- **Validation Examples**: 616  
- **Training Duration**: ~197.8 dakika
- **Trainable Parameters**: 62,586,880 (0.48%)
- **Final Train Loss**: 0.1901
- **Final Eval Loss**: 0.1577
- **GPU Memory**: 25.08 GB

## 🎯 Desteklenen Görevler

-**Python Algorithm Implementation**
-**Data Structures (Stack, Queue, etc.)**
-**Web Development (React, JavaScript)**
-**Data Analysis (Pandas, NumPy)**
-**Machine Learning Code**
-**SQL Query Generation**
-**Error Handling & Best Practices**

## 🚀 Kullanım

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

# Model ve tokenizer yükleme
model = AutoModelForCausalLM.from_pretrained(
    "AlpYzc/code-llama-13b-turkish-custom",
    torch_dtype=torch.float16,
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("AlpYzc/code-llama-13b-turkish-custom")

# Kod üretme fonksiyonu
def generate_code(prompt, max_length=200):
    inputs = tokenizer(prompt, return_tensors="pt")
    
    with torch.no_grad():
        outputs = model.generate(
            inputs.input_ids,
            max_length=max_length,
            temperature=0.7,
            do_sample=True,
            top_p=0.9,
            pad_token_id=tokenizer.eos_token_id
        )
    
    return tokenizer.decode(outputs[0], skip_special_tokens=True)

# Örnek kullanım
prompt = "def factorial(n):"
generated_code = generate_code(prompt)
print(generated_code)
```

## 📝 Örnek Çıktılar

### Factorial Function
```python
# Input: def factorial(n):
# Output:
def factorial(n):
    if n == 0:
        return 1
    else:
        return n * factorial(n - 1)
```

### Binary Search
```python
# Input: def binary_search(arr, target):
# Output:
def binary_search(arr, target):
    left, right = 0, len(arr) - 1
    
    while left <= right:
        mid = (left + right) // 2
        if arr[mid] == target:
            return mid
        elif arr[mid] < target:
            left = mid + 1
        else:
            right = mid - 1
    
    return -1
```

## ⚙️ Sistem Gereksinimleri

- **GPU Memory**: ~26GB (FP16)
- **RAM**: 32GB+ önerilir
- **CUDA**: 11.8+
- **Python**: 3.8+
- **Transformers**: 4.30+

## 🔧 Fine-tuning Detayları

- **LoRA (Low-Rank Adaptation)** kullanıldı
- **Learning Rate**: Adaptive
- **Batch Size**: Optimized for 13B model
- **Epochs**: 2-3
- **Validation Strategy**: Split validation

## 📈 Performance Metrics

Model şu alanlarda test edildi ve başarılı sonuçlar verdi:

1. **Algorithm Implementation**: ✅ Passed
2. **Data Structures**: ✅ Passed  
3. **Web Development**: ✅ Passed
4. **Data Processing**: ✅ Passed
5. **Machine Learning**: ✅ Passed
6. **Database Operations**: ✅ Passed

## ⚠️ Limitasyonlar

- Model 13B parametre içeriyor, yüksek GPU memory gerektirir
- Türkçe yorum satırları sınırlı olabilir
- Çok spesifik domain bilgisi gerektiren görevlerde ek fine-tuning gerekebilir
- Production kullanımında performans optimizasyonu yapılabilir

## 📞 İletişim & Support

Model ile ilgili sorular, öneriler veya collaboration için:
- GitHub Issues üzerinden
- HuggingFace Community sekmesinden

## 🙏 Acknowledgments

- **Meta AI** - Code Llama base model için
- **HuggingFace** - Transformers library için  
- **Google Colab** - Training environment için

---

*Bu model eğitim ve araştırma amaçlı geliştirilmiştir. Production kullanımında sorumluluğu kullanıcıya aittir.*