Add README.md & LICENSE
Browse files
LICENSE
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
|
2 |
+
|
3 |
+
This work is licensed under the **Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License**.
|
4 |
+
|
5 |
+
To view a copy of this license, visit [https://creativecommons.org/licenses/by-nc-sa/4.0/](https://creativecommons.org/licenses/by-nc-sa/4.0/) or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
|
6 |
+
|
7 |
+
---
|
8 |
+
|
9 |
+
## **Summary of Terms**
|
10 |
+
You are free to:
|
11 |
+
- **Share** โ copy and redistribute the material in any medium or format.
|
12 |
+
- **Adapt** โ remix, transform, and build upon the material.
|
13 |
+
|
14 |
+
**Under the following terms:**
|
15 |
+
- **Attribution (BY):** You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
|
16 |
+
- **Non-Commercial (NC):** You may not use the material for commercial purposes.
|
17 |
+
- **ShareAlike (SA):** If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
|
18 |
+
|
19 |
+
**No additional restrictions:** You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
|
20 |
+
|
21 |
+
---
|
22 |
+
|
23 |
+
## **Attribution Requirements**
|
24 |
+
When redistributing or adapting this work, you must include the following attribution in a clear and visible manner:
|
25 |
+
|
26 |
+
```
|
27 |
+
This work, containing model adapter weights, is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0).
|
28 |
+
Original works:
|
29 |
+
- Base Model: [https://huggingface.co/llm-jp/llm-jp-3-13b](https://huggingface.co/llm-jp/llm-jp-3-13b) (Apache License 2.0)
|
30 |
+
- Datasets:
|
31 |
+
- [ELYZA-tasks-100](https://huggingface.co/datasets/elyza/ELYZA-tasks-100) (CC BY-SA 4.0)
|
32 |
+
- [ichikara-instruction](https://liat-aip.sakura.ne.jp/wp/llm%E3%81%AE%E3%81%9F%E3%82%81%E3%81%AE%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%A9%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%83%87%E3%83%BC%E3%82%BF%E4%BD%9C%E6%88%90/) (CC BY-NC-SA 4.0)
|
33 |
+
This work:
|
34 |
+
- Adapter Weights: CC BY-NC-SA 4.0
|
35 |
+
- Creator: tokutsu
|
36 |
+
```
|
37 |
+
|
38 |
+
---
|
39 |
+
|
40 |
+
**Disclaimer:**
|
41 |
+
The materials are provided \"as is\", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, or non-infringement.
|
README.md
CHANGED
@@ -6,17 +6,85 @@ tags:
|
|
6 |
- unsloth
|
7 |
- llama
|
8 |
- trl
|
9 |
-
|
|
|
|
|
|
|
10 |
language:
|
11 |
-
-
|
|
|
|
|
|
|
12 |
---
|
13 |
|
14 |
-
#
|
15 |
|
16 |
-
|
17 |
-
- **License:** apache-2.0
|
18 |
-
- **Finetuned from model :** llm-jp/llm-jp-3-13b
|
19 |
|
20 |
-
This
|
21 |
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
- unsloth
|
7 |
- llama
|
8 |
- trl
|
9 |
+
licenses:
|
10 |
+
- Apache-2.0 # Base model
|
11 |
+
- CC-BY-NC-SA-4.0 # Adapter & Dataset (ichikara-instruction)
|
12 |
+
- CC-BY-SA-4.0 # Dataset (ELYZA-tasks-100)
|
13 |
language:
|
14 |
+
- ja
|
15 |
+
datasets:
|
16 |
+
- elyza/ELYZA-tasks-100
|
17 |
+
- ichikara-instruction
|
18 |
---
|
19 |
|
20 |
+
# llm-jp-3-13b-it: A Fine-tuned model for ELYZA-tasks-100
|
21 |
|
22 |
+
## Overview
|
|
|
|
|
23 |
|
24 |
+
This is a fine-tuned [`llm-jp-3-13b-it`](https://huggingface.co/tokutsu/llm-jp-3-13b-it) model for [ELYZA-tasks-100](https://huggingface.co/datasets/elyza/ELYZA-tasks-100). The model was trained on ELYZA-tasks-100 and the [ichikara-instruction dataset](https://liat-aip.sakura.ne.jp/wp/llm%E3%81%AE%E3%81%9F%E3%82%81%E3%81%AE%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%A9%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%83%87%E3%83%BC%E3%82%BF%E4%BD%9C%E6%88%90/).
|
25 |
|
26 |
+
## Usage
|
27 |
+
|
28 |
+
Load the model and tokenizer with the following code:
|
29 |
+
|
30 |
+
```python
|
31 |
+
from unsloth import FastLanguageModel
|
32 |
+
|
33 |
+
model_id = "tokutsu/llm-jp-3-13b-it"
|
34 |
+
|
35 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
36 |
+
model_name=model_id,
|
37 |
+
dtype=None,
|
38 |
+
load_in_4bit=True,
|
39 |
+
trust_remote_code=True,
|
40 |
+
)
|
41 |
+
FastLanguageModel.for_inference(model)
|
42 |
+
|
43 |
+
prompt = """### ๆ็คบ
|
44 |
+
ไปไบใฎ็ฑๆใๅใๆปใใใใฎใขใคใใขใ5ใคๆใใฆใใ ใใใ
|
45 |
+
|
46 |
+
### ๅ็ญ
|
47 |
+
"""
|
48 |
+
|
49 |
+
inputs = tokenizer([prompt], return_tensors="pt").to(model.device)
|
50 |
+
outputs = model(**inputs,
|
51 |
+
max_new_tokens=512,
|
52 |
+
use_cache=True,
|
53 |
+
do_sample=False,
|
54 |
+
repetition_penalty=1.2)
|
55 |
+
prediction = tokenizer.decode(outputs[0], skip_special_tokens=True).split('\n### ๅ็ญ')[-1]
|
56 |
+
```
|
57 |
+
|
58 |
+
## Example Output
|
59 |
+
|
60 |
+
Here is an example of what the output would look like:
|
61 |
+
|
62 |
+
```plaintext
|
63 |
+
1. ไปไบใซ้ข้ฃใใ่ถฃๅณใๆใค: ่ถฃๅณใฏในใใฌใน่งฃๆถใใชใฉใใฏในๅนๆใใใใไปไบใธใฎใขใใใผใทใงใณใขใใใซใใคใชใใใพใใไพใใฐใใฌใผใใใณใฐใๅฅฝใใชใใชใใฃในใง่ฆณ่ๆค็ฉใ่ฒใฆใใใๆ็ใๅพๆใงใใใฐๅๅใจใฉใณใไผใใใใชใฉใ่ชๅใชใใฎไปไบใจใฎๆฅ็นใ่ฆใคใใฆใฟใพใใใใ
|
64 |
+
2. ็ฎๆจ่จญๅฎใ่กใ: ้ๆๅฏ่ฝใช็ฎๆจใ็ซใฆใใใจใงใๆฅใ
ๆ้ทใใฆใใใใจใๅฎๆใงใใใใใใใ็ใพใใฆใใพใใใพใใๅฎๆ็ใซ้ฒๆ็ถๆณใ็ขบ่ชใใใใจใงใ้ๆๆใจใจใใซใใใชใใใๆฐใซใคใชใใใงใใใใ
|
65 |
+
3. ๅๅใใกใจไบคๆตใใ: ่ทๅ ดใงใฎไบบ้้ขไฟใฏใไปไบใซๅฏพใใๆ
็ฑใ็ถญๆใใใใใซ้่ฆใงใใใณใใฅใใฑใผใทใงใณใใจใใใจใงใใไบใใฎใใจใ็่งฃใใๅฉใๅใใใจใใงใใพใใ่ทๅ ดใฎใคใใณใใซๅๅ ใใใใไผๆฉๆ้ใซใฏ้่ซใใใใใฆใ็ฉๆฅต็ใซๅจใใฎไบบใจ้ขใใใพใใใใ
|
66 |
+
4. ๆฐใใในใญใซใ่บซใซใคใใ: ในใญใซๅไธใฎใใใฎๅๅผทใใๆฐใใ่ณๆ ผๅๅพใชใฉใซใใใ่ชๅใฎ่ฝๅใ้ซใใใใจใใงใใพใใ่ชๅทฑๅ็บ็ใชๆดปๅใใ่ชไฟกใๅไธๅฟใธใจใคใชใใใใใใใพใใใ
|
67 |
+
5. ไผๆใใจใฃใฆใชใใฌใใทใฅใใ: ้ทๆไผๆใใจใใๅฟ่บซใจใใซไผๆฏใใใใจใฏๅคงๅใชใใจใงใใๆ
่กใธ่กใฃใใใๅฎถๆใจไธ็ทใซ้ใใใใใใใใจใงๆฐๅ่ปขๆใใงใใใพใๆฐใใชๆฐๆใกใงไปไบใซๅใ็ตใใใจใใงใใใใใซใชใใพใใ
|
68 |
+
```
|
69 |
+
|
70 |
+
## Additional Information
|
71 |
+
|
72 |
+
The model was trained using LoRA with the following specifications:
|
73 |
+
|
74 |
+
### **Base Model**
|
75 |
+
- The training started with the pre-trained language model **`llm-jp/llm-jp-3-13b`**.
|
76 |
+
|
77 |
+
### **Datasets**
|
78 |
+
- **ELYZA-tasks-100:** A comprehensive dataset covering 100 diverse tasks, enhancing the model's ability to generalize across multiple domains. ([link](https://huggingface.co/datasets/elyza/ELYZA-tasks-100))
|
79 |
+
- **ichikara-instruction:** This dataset contains a diverse range of text samples, providing a strong foundation for understanding contextual nuances. ([link](https://liat-aip.sakura.ne.jp/wp/llm%E3%81%AE%E3%81%9F%E3%82%81%E3%81%AE%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%A9%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%83%87%E3%83%BC%E3%82%BF%E4%BD%9C%E6%88%90/))
|
80 |
+
|
81 |
+
### **Training Methodology**
|
82 |
+
- **PEFT with LoRA:** The training employed **PEFT (Parameter-Efficient Fine-Tuning)** using **LoRA (Low-Rank Adaptation)**, enabling efficient fine-tuning with reduced computational costs while retaining the model's performance. This model was trained with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
|
83 |
+
|
84 |
+
## License
|
85 |
+
|
86 |
+
This model is licensed under the **CC BY-NC-SA 4.0** License. For more details, see the [LICENSE](https://huggingface.co/tokutsu/llm-jp-3-13b-it/blob/main/LICENSE) file in this repository.
|
87 |
+
|
88 |
+
## Acknowledgment
|
89 |
+
|
90 |
+
This model was developed as part of the [LLM course 2024](https://weblab.t.u-tokyo.ac.jp/lecture/course-list/large-language-model/) exercises conducted by the Matsuo-Iwasawa Lab at the University of Tokyo.
|