File size: 1,319 Bytes
d38a9a1
 
 
 
 
 
 
 
 
 
 
0667bc5
d38a9a1
0667bc5
 
d38a9a1
0667bc5
d38a9a1
0667bc5
 
 
 
d38a9a1
0667bc5
 
d38a9a1
0667bc5
 
 
 
 
 
 
 
 
 
d38a9a1
0667bc5
d38a9a1
 
 
 
 
 
 
 
0667bc5
d38a9a1
0667bc5
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
license: cc-by-nc-sa-4.0
base_model:
- llm-jp/llm-jp-3-13b
---

## モデルのロードと推論

### Pythonスクリプト例

```python
from tqdm import tqdm

results = []
for data in tqdm(datasets):

  input = data["input"]

  prompt = f"""### 指示
  {input}
  ### 回答
  """

  tokenized_input = tokenizer.encode(prompt, add_special_tokens=False, return_tensors="pt").to(model.device)
  attention_mask = torch.ones_like(tokenized_input)

  with torch.no_grad():
      outputs = model.generate(
          tokenized_input,
          attention_mask=attention_mask,
          max_new_tokens=100,
          do_sample=False,
          repetition_penalty=1.2,
          pad_token_id=tokenizer.eos_token_id
      )[0]
  output = tokenizer.decode(outputs[tokenized_input.size(1):], skip_special_tokens=True)

  results.append({"task_id": data["task_id"], "input": input, "output": output})

## 引用情報

モデル元データセット:
- 関根聡, 安藤まや, 後藤美知子, 鈴木久美, 河原大輔, 井之上直也, 乾健太郎. 
- "ichikara-instruction: LLMのための日本語インストラクションデータの構築"
- 言語処理学会第30回年次大会 (2024)

## モデルの情報

- 開発者情報: YAI
- ライセンス: cc-by-nc-sa-4.0
- Finetuned from model : llm-jp/llm-jp-3-13b