tokutsu commited on
Commit
918ffed
โ€ข
1 Parent(s): a93a4df

Add README.md & LICENSE

Browse files
Files changed (2) hide show
  1. LICENSE +41 -0
  2. README.md +76 -8
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
- license: apache-2.0
 
 
 
10
  language:
11
- - en
 
 
 
12
  ---
13
 
14
- # Uploaded model
15
 
16
- - **Developed by:** tokutsu
17
- - **License:** apache-2.0
18
- - **Finetuned from model :** llm-jp/llm-jp-3-13b
19
 
20
- This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
21
 
22
- [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.