Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
license_link: https://huggingface.co/microsoft/phi-4/resolve/main/LICENSE
|
| 4 |
+
language:
|
| 5 |
+
- tr
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
tags:
|
| 8 |
+
- phi
|
| 9 |
+
- nlp
|
| 10 |
+
- instruction-tuning
|
| 11 |
+
- turkish
|
| 12 |
+
- chat
|
| 13 |
+
- conversational
|
| 14 |
+
inference:
|
| 15 |
+
parameters:
|
| 16 |
+
temperature: 0.7
|
| 17 |
+
widget:
|
| 18 |
+
- messages:
|
| 19 |
+
- role: user
|
| 20 |
+
content: "Internet'i nasıl açıklayabilirim?"
|
| 21 |
+
library_name: transformers
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
# Phi-4 Turkish Instruction-Tuned Model
|
| 25 |
+
|
| 26 |
+
This model is a fine-tuned version of Microsoft's **Phi-4** model for Turkish instruction-following tasks. It was trained on a **55,000-sample Turkish instruction dataset**, making it well-suited for generating helpful and coherent responses in Turkish.
|
| 27 |
+
|
| 28 |
+
## Model Summary
|
| 29 |
+
|
| 30 |
+
| | |
|
| 31 |
+
|-------------------------|-----------------------------------------------|
|
| 32 |
+
| **Developers** | Baran Bingöl (Hugging Face: [barandinho](https://huggingface.co/barandinho)) |
|
| 33 |
+
| **Base Model** | [microsoft/phi-4](https://huggingface.co/microsoft/phi-4) |
|
| 34 |
+
| **Architecture** | 14B parameters, dense decoder-only Transformer|
|
| 35 |
+
| **Training Data** | 55K Turkish instruction samples |
|
| 36 |
+
| **Context Length** | 16K tokens |
|
| 37 |
+
| **License** | MIT ([License Link](https://huggingface.co/microsoft/phi-4/resolve/main/LICENSE)) |
|
| 38 |
+
|
| 39 |
+
## Intended Use
|
| 40 |
+
|
| 41 |
+
### Primary Use Cases
|
| 42 |
+
- Turkish conversational AI systems
|
| 43 |
+
- Chatbots and virtual assistants
|
| 44 |
+
- Educational tools for Turkish users
|
| 45 |
+
- General-purpose text generation in Turkish
|
| 46 |
+
|
| 47 |
+
### Out-of-Scope Use Cases
|
| 48 |
+
- High-risk domains (medical, legal, financial advice) without proper evaluation
|
| 49 |
+
- Use in sensitive or safety-critical systems without safeguards
|
| 50 |
+
|
| 51 |
+
## Usage
|
| 52 |
+
|
| 53 |
+
### Input Formats
|
| 54 |
+
|
| 55 |
+
Given the nature of the training data, `phi-4` is best suited for prompts using the chat format as follows:
|
| 56 |
+
|
| 57 |
+
```bash
|
| 58 |
+
<|im_start|>system<|im_sep|>
|
| 59 |
+
Sen yardımsever bir yapay zekasın.<|im_end|>
|
| 60 |
+
<|im_start|>user<|im_sep|>
|
| 61 |
+
Kuantum hesaplama neden önemlidir?<|im_end|>
|
| 62 |
+
<|im_start|>assistant<|im_sep|>
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
### With `transformers`
|
| 66 |
+
|
| 67 |
+
```python
|
| 68 |
+
import transformers
|
| 69 |
+
|
| 70 |
+
pipeline = transformers.pipeline(
|
| 71 |
+
"text-generation",
|
| 72 |
+
model="barandinho/phi4-turkish-instruct",
|
| 73 |
+
model_kwargs={"torch_dtype": "auto"},
|
| 74 |
+
device_map="auto",
|
| 75 |
+
)
|
| 76 |
+
|
| 77 |
+
messages = [
|
| 78 |
+
{"role": "system", "content": "Sen yardımsever bir yapay zekasın."},
|
| 79 |
+
{"role": "user", "content": "Kuantum hesaplama neden önemlidir?"},
|
| 80 |
+
]
|
| 81 |
+
|
| 82 |
+
outputs = pipeline(messages, max_new_tokens=128)
|
| 83 |
+
print(outputs[0]["generated_text"][-1])
|
| 84 |
+
```
|