File size: 2,870 Bytes
cf28849
 
 
 
 
 
 
 
 
 
 
 
 
 
f7493e6
cf28849
2c35411
 
 
 
 
 
 
 
cf28849
 
 
 
 
 
 
f7493e6
cf28849
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5030490
 
 
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
datasets:
  - augmxnt/shisa-pretrain-en-ja-v1
language:
  - ja
pipeline_tag: text-generation
tags:
  - OpenAccess AI Collective
  - MPT
  - axolotl
  - PyTorch
  - Transformers
---

# TinySlime-1.1B-v1.0

TinySlime は日本語に特化した小規模言語モデルです。

モデルの一覧

- [TinySlime-1.1B-v1.0](https://huggingface.co/2121-8/TinySlime-1.1B-v1.0)
- [TinySlime-1.1B-Chat-v1.0](https://huggingface.co/2121-8/TinySlime-1.1B-Chat-v1.0)

</br>

このモデルのフルチューニングは、[Axolotl](https://github.com/OpenAccess-AI-Collective/axolotl) を使用して行われました。

[<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)

## モデル概要

2121-8/TinySlime-1.1B-v1.0 は、TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T をベースモデルとし、augmxnt/shisa-pretrain-en-ja-v1 の学習データを使用してトレーニングされたモデルです。本モデルは、5.5B のトークンで学習されました。
このモデルは、スマートフォン、NVIDIA Jetson などの組み込みで動かすことを想定し作成されました。

- **ベースモデル**: TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T
- **学習データセット**: augmxnt/shisa-pretrain-en-ja-v1
- **学習トークン**: 55 億

## 使用方法

### インストール

このモデルを使用するには、Hugging Face の`transformers`ライブラリをインストールする必要があります

```bash
pip install -U transformers
```

### モデルの読み込み

`transformers`ライブラリを使用してモデルを読み込むことができます

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "2121-8/TinyLlama-v1.0"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModel.from_pretrained(model_name)
```

### テキスト生成

以下の例では、読み込んだモデルを使用してテキストを生成する方法を示します

```python
input_text = "西郷隆盛は明治時代の"
input_ids = tokenizer.encode(input_text, return_tensors='pt')

# テキストを生成
outputs = model.generate(input_ids, max_length=50, num_return_sequences=1)
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)

print(generated_text)
```

## 謝辞

このモデルは、TinyLlama プロジェクトの成果に基づいて構築され、`augmxnt/shisa-pretrain-en-ja-v1`データセットを使用して学習されました。
また、このモデルの開発にあたり、[Axolotl](https://github.com/OpenAccess-AI-Collective/axolotl) のサポートとツールを利用しました。
NLP コミュニティへの貢献に感謝します。