Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,57 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- ja
|
5 |
+
pipeline_tag: text-generation
|
6 |
+
base_model: SakanaAI/TinySwallow-1.5B-Instruct
|
7 |
+
datasets:
|
8 |
+
- tokyotech-llm/lmsys-chat-1m-synth
|
9 |
+
- tokyotech-llm/swallow-magpie-ultra-v0.1
|
10 |
+
- tokyotech-llm/swallow-swallow-gemma-magpie-v0.1
|
11 |
+
tags:
|
12 |
+
- M5Stack Module LLM
|
13 |
+
---
|
14 |
+
|
15 |
+
# TinySwallow-1.5B-Instruct-w8a16
|
16 |
+
|
17 |
+
このモデルは、[SakanaAI/TinySwallow-1.5B-Instruct](https://huggingface.co/SakanaAI/TinySwallow-1.5B-Instruct) を、
|
18 |
+
[M5Stack Module LLM](https://docs.m5stack.com/ja/module/Module-LLM)向けに、[ax-llm-build](https://github.com/AXERA-TECH/ax-llm-build)で変換したモデルになります。
|
19 |
+
詳細な変換手順は[pulsar2ドキュメント](https://pulsar2-docs.readthedocs.io/en/latest/appendix/build_llm.html#large-model-compilation-experimental-stage)を参考にしてください。
|
20 |
+
|
21 |
+
アップロードした`axmodel`は次のようなコマンドで変換しています。
|
22 |
+
|
23 |
+
```bash
|
24 |
+
pulsar2 llm_build --input_path /path/to/TinySwallow-1.5B-Instruct/ --output_path /path/to/TinySwallow-1.5B-Instruct-ax630c --kv_cache_len 1653 --model_config /path/to/TinySwallow-1.5B-Instruct/config.json --hidden_state_type bf16 --chip AX620E --prefill_len 128
|
25 |
+
```
|
26 |
+
※ 利用したpulser2コンテナは3.3になります。
|
27 |
+
|
28 |
+
## 使い方
|
29 |
+
|
30 |
+
別途`main_prefill`を入手し本リポジトリファイル群とともにModule LLMに配備してください。
|
31 |
+
- [AXERA-TECH/DeepSeek-R1-Distill-Qwen-1.5B](https://huggingface.co/AXERA-TECH/DeepSeek-R1-Distill-Qwen-1.5B) など
|
32 |
+
|
33 |
+
|
34 |
+
DeepSeek-R1の例に従い事前にトークナイザをHTTPサーバとして起動します(別ターミナルまたはバックグラウンド起動)。
|
35 |
+
|
36 |
+
```bash
|
37 |
+
python3 tinyswallow_tokenizer.py
|
38 |
+
```
|
39 |
+
|
40 |
+
トークナイザ起動語にデバッグ用のスクリプトを実行します。
|
41 |
+
|
42 |
+
```bash
|
43 |
+
./run_TinySwallow_1.5B_prefill_ax630c.sh
|
44 |
+
[I][ Init][ 125]: LLM init start
|
45 |
+
bos_id: -1, eos_id: 151645
|
46 |
+
3% | ██ | 1 / 31 [0.01s<0.28s, 111.11 count/s] tokenizer init ok[I][ Init][ 26]: LLaMaEmbedSelector use mmap
|
47 |
+
100% | ████████████████████████████████ | 31 / 31 [8.15s<8.15s, 3.80 count/s] init post axmodel ok,remain_cmm(1434 MB)[I][ Init][ 241]: max_token_len : 1653
|
48 |
+
[I][ Init][ 246]: kv_cache_size : 256, kv_cache_num: 1653
|
49 |
+
[I][ Init][ 254]: prefill_token_num : 128
|
50 |
+
[I][ Init][ 263]: LLM init ok
|
51 |
+
Type "q" to exit, Ctrl+c to stop current running
|
52 |
+
>> こんにちは!
|
53 |
+
[I][ Run][ 484]: ttft: 1066.67 ms
|
54 |
+
こんにちは! ��
|
55 |
+
|
56 |
+
何かお手伝いできることはありますか? 😊
|
57 |
+
```
|