JunichiroMorita
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -1,23 +1,56 @@
|
|
1 |
-
---
|
2 |
-
base_model: llm-jp/llm-jp-3-13b
|
3 |
-
tags:
|
4 |
-
- text-generation-inference
|
5 |
-
- transformers
|
6 |
-
- unsloth
|
7 |
-
- llama
|
8 |
-
- trl
|
9 |
-
license: apache-2.0
|
10 |
-
language:
|
11 |
-
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
18 |
|
19 |
- **Developed by:** JunichiroMorita
|
20 |
-
- **License:**
|
21 |
- **Finetuned from model :** llm-jp/llm-jp-3-13b
|
22 |
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: llm-jp/llm-jp-3-13b
|
3 |
+
tags:
|
4 |
+
- text-generation-inference
|
5 |
+
- transformers
|
6 |
+
- unsloth
|
7 |
+
- llama
|
8 |
+
- trl
|
9 |
+
license: apache-2.0
|
10 |
+
language:
|
11 |
+
- ja
|
12 |
+
datasets:
|
13 |
+
- weblab-GENIAC/aya-ja-evol-instruct-calm3-dpo-masked
|
14 |
+
widget:
|
15 |
+
- text: 生成AIについて説明して下さい。
|
16 |
+
---
|
17 |
+
|
18 |
+
# llm-jp-3-13b_lora_20241130
|
19 |
|
20 |
- **Developed by:** JunichiroMorita
|
21 |
+
- **License:** CC-BY-NC-SA
|
22 |
- **Finetuned from model :** llm-jp/llm-jp-3-13b
|
23 |
|
24 |
+
# Usage
|
25 |
+
```python
|
26 |
+
import torch
|
27 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
28 |
+
tokenizer = AutoTokenizer.from_pretrained("JunichiroMorita/llm-jp-3-13b_lora_20241130")
|
29 |
+
model = AutoModelForCausalLM.from_pretrained("JunichiroMorita/llm-jp-3-13b_lora_20241130", device_map="auto", torch_dtype=torch.bfloat16)
|
30 |
+
chat = [
|
31 |
+
{"role": "system", "content": "以下は、タスクを説明する指示です。要求を適切に満たす応答を書きなさい。"},
|
32 |
+
{"role": "user", "content": "自然言語処理とは何か"},
|
33 |
+
]
|
34 |
+
tokenized_input = tokenizer.apply_chat_template(chat, add_generation_prompt=True, tokenize=True, return_tensors="pt").to(model.device)
|
35 |
+
with torch.no_grad():
|
36 |
+
output = model.generate(
|
37 |
+
tokenized_input,
|
38 |
+
max_new_tokens=100,
|
39 |
+
do_sample=True,
|
40 |
+
top_p=0.95,
|
41 |
+
temperature=0.7,
|
42 |
+
repetition_penalty=1.05,
|
43 |
+
)[0]
|
44 |
+
print(tokenizer.decode(output))
|
45 |
+
|
46 |
+
```
|
47 |
+
|
48 |
+
# Data
|
49 |
+
|
50 |
+
## LoRA
|
51 |
+
- [llmのための日本語インストラクションデータ (CC-BY-NC-SA)](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/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-%e5%85%ac%e9%96%8b/)\[1]
|
52 |
+
|
53 |
+
\[1]:関根聡, 安藤まや, 後藤美知子, 鈴木久美, 河原大輔, 井之上直也, 乾健太郎. ichikara-instruction: LLMのための日本語インストラクションデータの構築. 言語処理学会第30回年次大会(2024)
|
54 |
+
|
55 |
+
## DPO
|
56 |
+
- [aya-ja-evol-instruct-calm3-dpo-masked (Apache-2.0)](https://huggingface.co/datasets/weblab-GENIAC/aya-ja-evol-instruct-calm3-dpo-masked)
|