0626
Browse files
README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
language:
|
| 4 |
+
- ko
|
| 5 |
+
- en
|
| 6 |
+
library_name: transformers
|
| 7 |
+
tags:
|
| 8 |
+
- instruction-tuning
|
| 9 |
+
- korean
|
| 10 |
+
- phi-4
|
| 11 |
+
- causal-lm
|
| 12 |
+
model_creator: microsoft
|
| 13 |
+
base_model: microsoft/Phi-4-mini-instruct
|
| 14 |
+
model_name: Phi-4-mini-instruct-Ko
|
| 15 |
+
pipeline_tag: text-generation
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# Phi-4-mini-instruct-Ko
|
| 19 |
+
|
| 20 |
+
This model is a fine-tuned version of [`microsoft/Phi-4-mini-instruct`](https://huggingface.co/microsoft/Phi-4-mini-instruct), adapted for Korean instruction-based tasks. The tuning was focused on enhancing Korean performance through supervised fine-tuning with Korean instruction datasets.
|
| 21 |
+
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
## 🔧 Token Adjustments
|
| 25 |
+
|
| 26 |
+
The original model used the same token ID (199999) for multiple special tokens such as BOS, EOS, PAD, and UNK. This caused confusion in instruction-following tasks. We fixed this by remapping the token IDs as follows:
|
| 27 |
+
|
| 28 |
+
| Token Type | Original ID | Fixed ID | Fixed Token |
|
| 29 |
+
|------------|-------------|----------|-------------|
|
| 30 |
+
| BOS | 199999 | 199999 | `<|endoftext|>` |
|
| 31 |
+
| EOS | 199999 | 200020 | `<|end|>` |
|
| 32 |
+
| PAD | 199999 | 200029 | `<|dummy_85|>` |
|
| 33 |
+
| UNK | 199999 | 200030 | `�` |
|
| 34 |
+
|
| 35 |
+
These changes ensure proper differentiation and functioning of special tokens during generation and training.
|
| 36 |
+
|
| 37 |
+
---
|
| 38 |
+
|
| 39 |
+
## 🗨️ Chat Template
|
| 40 |
+
|
| 41 |
+
The chat template was updated accordingly to support multi-turn conversation formatting in the Korean context:
|
| 42 |
+
|
| 43 |
+
```jinja2
|
| 44 |
+
{% for message in messages %}
|
| 45 |
+
{% if message['role'] == 'system' and 'tools' in message and message['tools'] is not none %}
|
| 46 |
+
{{ '<|' + message['role'] + '|>' + message['content'] + '<|tool|>' + message['tools'] + '<|/tool|>' + '<|end|>' }}
|
| 47 |
+
{% else %}
|
| 48 |
+
{{ '<|' + message['role'] + '|>' + message['content'] + '<|end|>' }}
|
| 49 |
+
{% endif %}
|
| 50 |
+
{% endfor %}
|
| 51 |
+
{% if add_generation_prompt %}{{ '<|assistant|>' }}{% endif %}
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
## 📌 Caution
|
| 55 |
+
* Commercial use is strictly prohibited.
|
| 56 |
+
|
| 57 |
+
* This model is intended for research and educational use only.
|
| 58 |
+
|
| 59 |
+
* Redistribution or use in commercial products or services is not allowed.
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
## ✍️ Acknowledgments
|
| 63 |
+
* Base model: microsoft/Phi-4-mini-instruct
|
| 64 |
+
* Special thanks to the open-source community for instruction-tuning resources and Korean language corpora.
|