Add mlc-chat iOS pre-built lib & weights
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- README.md +39 -0
- RWKV-4-World-3B-q4f16_2-iphone.tar +3 -0
- params/mlc-chat-config.json +17 -0
- params/ndarray-cache.json +0 -0
- params/params_shard_0.bin +3 -0
- params/params_shard_1.bin +3 -0
- params/params_shard_10.bin +3 -0
- params/params_shard_11.bin +3 -0
- params/params_shard_12.bin +3 -0
- params/params_shard_13.bin +3 -0
- params/params_shard_14.bin +3 -0
- params/params_shard_15.bin +3 -0
- params/params_shard_16.bin +3 -0
- params/params_shard_17.bin +3 -0
- params/params_shard_18.bin +3 -0
- params/params_shard_19.bin +3 -0
- params/params_shard_2.bin +3 -0
- params/params_shard_20.bin +3 -0
- params/params_shard_21.bin +3 -0
- params/params_shard_22.bin +3 -0
- params/params_shard_23.bin +3 -0
- params/params_shard_24.bin +3 -0
- params/params_shard_25.bin +3 -0
- params/params_shard_26.bin +3 -0
- params/params_shard_27.bin +3 -0
- params/params_shard_28.bin +3 -0
- params/params_shard_29.bin +3 -0
- params/params_shard_3.bin +3 -0
- params/params_shard_30.bin +3 -0
- params/params_shard_31.bin +3 -0
- params/params_shard_32.bin +3 -0
- params/params_shard_33.bin +3 -0
- params/params_shard_34.bin +3 -0
- params/params_shard_35.bin +3 -0
- params/params_shard_36.bin +3 -0
- params/params_shard_37.bin +3 -0
- params/params_shard_38.bin +3 -0
- params/params_shard_39.bin +3 -0
- params/params_shard_4.bin +3 -0
- params/params_shard_40.bin +3 -0
- params/params_shard_41.bin +3 -0
- params/params_shard_42.bin +3 -0
- params/params_shard_43.bin +3 -0
- params/params_shard_44.bin +3 -0
- params/params_shard_45.bin +3 -0
- params/params_shard_46.bin +3 -0
- params/params_shard_47.bin +3 -0
- params/params_shard_48.bin +3 -0
- params/params_shard_49.bin +3 -0
- params/params_shard_5.bin +3 -0
README.md
CHANGED
@@ -1,3 +1,42 @@
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
---
|
4 |
+
# mlc-chat iOS pre-built RWKV-4-World-3B
|
5 |
+
|
6 |
+
https://github.com/mlc-ai/mlc-llm
|
7 |
+
https://mlc.ai/mlc-llm/docs/deploy/ios.html
|
8 |
+
|
9 |
+
RWKV-4-World的Hugface格式,因新版World的tokenizer较之前Raven\Pile版本有较大变化,因而需要进行新版HF适配
|
10 |
+
ringrwkv兼容了原生rwkv库和transformers的rwkv库,同时新添入World版本的配置及代码(支持1.5B,3B,7B全系列),并修复了原HF的RWKV在
|
11 |
+
Forward RWKVOutput时的细微问题,主要是引入和明确last_hidden_state。以下是轻量级使用代码,比较方便:<br>
|
12 |
+
|
13 |
+
RingRWKV GIT开源地址:https://github.com/StarRing2022/RingRWKV <br>
|
14 |
+
|
15 |
+
import torch<br>
|
16 |
+
from ringrwkv.configuration_rwkv_world import RwkvConfig<br>
|
17 |
+
from ringrwkv.rwkv_tokenizer import TRIE_TOKENIZER<br>
|
18 |
+
from ringrwkv.modehf_world import RwkvForCausalLM<br>
|
19 |
+
|
20 |
+
|
21 |
+
model = RwkvForCausalLM.from_pretrained("StarRing2022/RWKV-4-World-3B") #或将本模型下载至本地文件夹<br>
|
22 |
+
tokenizer = TRIE_TOKENIZER('./ringrwkv/rwkv_vocab_v20230424.txt')<br>
|
23 |
+
|
24 |
+
text = "你叫什么名字?"<br>
|
25 |
+
|
26 |
+
question = f'Question: {text.strip()}\n\nAnswer:'<br>
|
27 |
+
|
28 |
+
input_ids = tokenizer.encode(question)<br>
|
29 |
+
input_ids = torch.tensor(input_ids).unsqueeze(0)<br>
|
30 |
+
|
31 |
+
out = model.generate(input_ids,max_new_tokens=40)<br><br>
|
32 |
+
|
33 |
+
|
34 |
+
outlist = out[0].tolist()<br>
|
35 |
+
|
36 |
+
for i in outlist:<br>
|
37 |
+
if i==0: #要删除tokenid为0的元素 <br>
|
38 |
+
outlist.remove(i)<br>
|
39 |
+
|
40 |
+
answer = tokenizer.decode(outlist)<br>
|
41 |
+
|
42 |
+
print(answer)<br>
|
RWKV-4-World-3B-q4f16_2-iphone.tar
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1c837c01e5584159b318b8956fe2f38b064f1271dfc0f6326a3adad97734b09f
|
3 |
+
size 275643
|
params/mlc-chat-config.json
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"model_lib": "RWKV-4-World-3B-q4f16_2",
|
3 |
+
"local_id": "RWKV-4-World-3B-q4f16_2",
|
4 |
+
"conv_template": "rwkv_world",
|
5 |
+
"temperature": 1.2,
|
6 |
+
"repetition_penalty": 0.996,
|
7 |
+
"top_p": 0.6,
|
8 |
+
"mean_gen_len": 128,
|
9 |
+
"max_gen_len": 512,
|
10 |
+
"max_window_size": 1024,
|
11 |
+
"num_shards": 1,
|
12 |
+
"shift_fill_factor": 0.3,
|
13 |
+
"tokenizer_files": [],
|
14 |
+
"model_category": "rwkv_world",
|
15 |
+
"model_name": "RWKV-4-World-3B",
|
16 |
+
"vocab_size": 65536
|
17 |
+
}
|
params/ndarray-cache.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
params/params_shard_0.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:162ecb45106c045d7312341bc62b29fff147876b506a26d080b27975c25f4ec1
|
3 |
+
size 335544320
|
params/params_shard_1.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:733f03ac7754a758756dc241aa45f7c0d30209edaa0ef839e4720ec215a9850f
|
3 |
+
size 33254400
|
params/params_shard_10.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9a58142931435976b96bd4269dcf154d63aa80818ddc46f84b01ace896652c02
|
3 |
+
size 33187840
|
params/params_shard_11.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4ec390e9b5c3c2f2eb1c45de1cc47bcd8fc777161e0a09fd7d936dc809a35682
|
3 |
+
size 29557760
|
params/params_shard_12.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1aee79a98bfc33f6d04a5897262c63a933dfc6563354144d05296ad9eb169eda
|
3 |
+
size 33233920
|
params/params_shard_13.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b2ab2dbaf6111a55bdd8014e8a5fc9fd148b088c8292533fe679e63c85888c14
|
3 |
+
size 33187840
|
params/params_shard_14.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c459b888676cfe2d0e2ce607e650ef185e0062f0c8f09ca67f85911eebe141ea
|
3 |
+
size 29557760
|
params/params_shard_15.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9434c31538f9fe03b562f13379c6a94c69e2b28607a7d65719c88765c32df75b
|
3 |
+
size 33233920
|
params/params_shard_16.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:499fd854e7869d11ce3bef41345935933c8fbaab1a0136c5804c6d58de90529d
|
3 |
+
size 33187840
|
params/params_shard_17.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bd8568093446db25648bfcd97641dd369760e96dec37327b2cc55611410ff7f9
|
3 |
+
size 29557760
|
params/params_shard_18.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2ab8ca4ea157d0658307ba0692c9832030f2819fd8f97191b38bf40409b7d8f4
|
3 |
+
size 33233920
|
params/params_shard_19.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dad576a970df0b22199942b6c22f3f6b1cfbab0b57230fb608b4a0e906464bc2
|
3 |
+
size 33187840
|
params/params_shard_2.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bbf06d801e61e7411b3aa1a4fde604bec6def2987acca1b9bfb82efcf3a51876
|
3 |
+
size 29557760
|
params/params_shard_20.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8a145c53593e96326f08c0b498f8726095858c2479c833bd6ab59abc1d5af5c8
|
3 |
+
size 29557760
|
params/params_shard_21.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6a56779f441d19f10cc9770739c03aec0019c9b0d114b497904b49c13a62af4f
|
3 |
+
size 33233920
|
params/params_shard_22.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8979e34b9f31498782471b35304813441e9b0087e523de69cb04756eb4384d83
|
3 |
+
size 33187840
|
params/params_shard_23.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0d8df2d28fa738740fc69614717d5019059064a7d31a2dd20246813b424e806e
|
3 |
+
size 29557760
|
params/params_shard_24.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a61ae12e0b9d0ba4352b8b3e2c5247f2ee5e465b2fc12bae60582caea6a4c269
|
3 |
+
size 33233920
|
params/params_shard_25.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:09f2fc2b0b508031193c478e071ab1caeb6d4ba53d10ae02d638a8b5684f0ba1
|
3 |
+
size 33187840
|
params/params_shard_26.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cd89159f93f09e8ea627f5bac439ad1c7f67104921c8350e6572535d4d4ff399
|
3 |
+
size 29557760
|
params/params_shard_27.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9d6d4904ccd626f3114e8aafbc873fdaa47ecc63780417d65335209ca5499a04
|
3 |
+
size 33233920
|
params/params_shard_28.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5f373ca8e8ae330208597f4734bcdb15caf4633376dad8d57a7b91f38eb55614
|
3 |
+
size 33187840
|
params/params_shard_29.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ea8ccb395aee30709305b070aaaede18d6ca92ae55103a388b205eef22b59018
|
3 |
+
size 29557760
|
params/params_shard_3.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:86746d2c9cbf52188e915f4950574bcb0a3a3c518baabbd2415a943038ac6249
|
3 |
+
size 33233920
|
params/params_shard_30.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6d47fb56480f92ec7e04bf4ae16ef80602a184638393dec0f0468101f4512088
|
3 |
+
size 33233920
|
params/params_shard_31.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6f342cafb94c2bc2fcfa5c3d5c438b1d681ba286b4cf8e55e3773060dd1567c5
|
3 |
+
size 33187840
|
params/params_shard_32.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:984513b8de4ed243453ea63d0ca463e06f969f43446668813e20a939f47343b8
|
3 |
+
size 29557760
|
params/params_shard_33.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:95cb950dba63443f68aa093726e9a6867679b0901b8f43e589e9ae15e4c2008c
|
3 |
+
size 33233920
|
params/params_shard_34.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fb16d77d724f6ac4c57e2974b33d1cbba032d2f786c1c73d5bafd55c63f15a6b
|
3 |
+
size 33187840
|
params/params_shard_35.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a5836572e959f39b93318252f1520dfc0b29970c00341c304888db166b12fe8e
|
3 |
+
size 29557760
|
params/params_shard_36.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0caada216b2d2077662a5cee2d0e3b6736b24baed82210a499648a7533bcf411
|
3 |
+
size 33233920
|
params/params_shard_37.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cd37874f360f9fbb4b31bb7093274f1c51045378896111cf98d70757bff60192
|
3 |
+
size 33187840
|
params/params_shard_38.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f45f032d15ed614ca33f7b772213d2391e76faedb546c3baf8fa15773c547ece
|
3 |
+
size 29557760
|
params/params_shard_39.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:46b1f0d1eb84f52f603dd42d1b619699dafa276d05bade85ce86036877b0fb5c
|
3 |
+
size 33233920
|
params/params_shard_4.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a3aae70c9663ca26a45ad302c401df6c84dba01e15e805cadfa942e3b6f9fb42
|
3 |
+
size 33187840
|
params/params_shard_40.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a9321dadb3852c534f12b0312303e9cd343ded6bac0ee213e30604b3a10cf82d
|
3 |
+
size 33187840
|
params/params_shard_41.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:08e595dcfa5ac0f0f26eac17180af1c46450251b2ae5a74c34dd7f061aa23d1b
|
3 |
+
size 29557760
|
params/params_shard_42.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:efa14d78dcf6d504b2a4d1754c747b9ea4eb537f8115b48c63e70aec9f5b4215
|
3 |
+
size 33233920
|
params/params_shard_43.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:15a367207dd148865fd4a3d28a72c17f91fe3e78371be80e6409b9b24f10510f
|
3 |
+
size 33187840
|
params/params_shard_44.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f45a44cc0c080efa960d1e2d63c5f7566274098cbd1b22f6b02456ff702f852e
|
3 |
+
size 29557760
|
params/params_shard_45.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7d1b0a0814b538dd204c38796271fa8bb914a7c228b9234b72c225249df62ef4
|
3 |
+
size 33233920
|
params/params_shard_46.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5d210348a27ef98e9e0f4475cbc1db3223315a44d69a002dbbf7ad26e56332dd
|
3 |
+
size 33187840
|
params/params_shard_47.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:275dac80135cba08e56d626a31054b8bcde55ae49b47829f7f14351a329f5298
|
3 |
+
size 29557760
|
params/params_shard_48.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:86d5720ad385e6e38b23558dd51116dc1f6e11a9814cb417f45047286120f3e1
|
3 |
+
size 335544320
|
params/params_shard_49.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ccf5919fee5f38d4489179edda1749e7c80e52c3edafd6088d1a0db1527e1715
|
3 |
+
size 33187840
|
params/params_shard_5.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7e669eb711be7afba3b252a8e79fb0e2a0215f0e39050fc64bd5cebf0915b15e
|
3 |
+
size 29557760
|