upload model
Browse files- README.md +31 -0
- README_zh-CN.md +34 -0
- config.json +29 -0
- generation_config.json +6 -0
- model.safetensors +3 -0
- special_tokens_map.json +23 -0
- tokenizer.json +0 -0
- tokenizer_config.json +37 -0
README.md
CHANGED
@@ -1,3 +1,34 @@
|
|
1 |
---
|
2 |
license: gpl-3.0
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: gpl-3.0
|
3 |
---
|
4 |
+
# **NanoTranslator-M**
|
5 |
+
|
6 |
+
## Introduction
|
7 |
+
|
8 |
+
这是 NanoTranslator 的 Medium 型号,目前仅支持**英译中**。仓库中同时提供了 ONNX 版本的模型。
|
9 |
+
|
10 |
+
|
11 |
+
|
12 |
+
| Size | Params. | V. | H. | I. | L. | Att. H. | KV H. | Tie Emb. |
|
13 |
+
| :--: | :-----: | :--: | :--: | :--: | :--: | :-----: | :---: | :------: |
|
14 |
+
| XL | 50 M | 8000 | 320 | 1792 | 24 | 16 | 4 | True |
|
15 |
+
| L | 22 M | 8000 | 256 | 1408 | 16 | 16 | 4 | True |
|
16 |
+
| M | 9 M | 4000 | 168 | 896 | 16 | 12 | 4 | True |
|
17 |
+
| S | 2 M | 2000 | 96 | 512 | 12 | 12 | 4 | True |
|
18 |
+
|
19 |
+
- **V.** - vocab size
|
20 |
+
- **H.** - hidden size
|
21 |
+
- **I.** - intermediate size
|
22 |
+
- **L.** - num layers
|
23 |
+
- **Att. H.** - num attention heads
|
24 |
+
- **KV H.** - num kv heads
|
25 |
+
- **Tie Emb.** - tie word embeddings
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
+
## How to use
|
30 |
+
|
31 |
+
### Normal
|
32 |
+
|
33 |
+
|
34 |
+
### ONNX
|
README_zh-CN.md
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: gpl-3.0
|
3 |
+
---
|
4 |
+
# **NanoTranslator-M**
|
5 |
+
|
6 |
+
## Introduction
|
7 |
+
|
8 |
+
这是 NanoTranslator 的 Medium 型号,目前仅支持**英译中**。仓库中同时提供了 ONNX 版本的模型。
|
9 |
+
|
10 |
+
|
11 |
+
|
12 |
+
| Size | Params. | V. | H. | I. | L. | Att. H. | KV H. | Tie Emb. |
|
13 |
+
| :--: | :-----: | :--: | :--: | :--: | :--: | :-----: | :---: | :------: |
|
14 |
+
| XL | 50 M | 8000 | 320 | 1792 | 24 | 16 | 4 | True |
|
15 |
+
| L | 22 M | 8000 | 256 | 1408 | 16 | 16 | 4 | True |
|
16 |
+
| M | 9 M | 4000 | 168 | 896 | 16 | 12 | 4 | True |
|
17 |
+
| S | 2 M | 2000 | 96 | 512 | 12 | 12 | 4 | True |
|
18 |
+
|
19 |
+
- **V.** - vocab size
|
20 |
+
- **H.** - hidden size
|
21 |
+
- **I.** - intermediate size
|
22 |
+
- **L.** - num layers
|
23 |
+
- **Att. H.** - num attention heads
|
24 |
+
- **KV H.** - num kv heads
|
25 |
+
- **Tie Emb.** - tie word embeddings
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
+
## How to use
|
30 |
+
|
31 |
+
### Normal
|
32 |
+
|
33 |
+
|
34 |
+
### ONNX
|
config.json
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "Mxode/NanoTranslator-M",
|
3 |
+
"architectures": [
|
4 |
+
"LlamaForCausalLM"
|
5 |
+
],
|
6 |
+
"attention_bias": false,
|
7 |
+
"attention_dropout": 0.0,
|
8 |
+
"bos_token_id": 1,
|
9 |
+
"eos_token_id": 2,
|
10 |
+
"hidden_act": "silu",
|
11 |
+
"hidden_size": 168,
|
12 |
+
"initializer_range": 0.02,
|
13 |
+
"intermediate_size": 896,
|
14 |
+
"max_position_embeddings": 2048,
|
15 |
+
"mlp_bias": false,
|
16 |
+
"model_type": "llama",
|
17 |
+
"num_attention_heads": 12,
|
18 |
+
"num_hidden_layers": 16,
|
19 |
+
"num_key_value_heads": 4,
|
20 |
+
"pretraining_tp": 1,
|
21 |
+
"rms_norm_eps": 1e-06,
|
22 |
+
"rope_scaling": null,
|
23 |
+
"rope_theta": 10000.0,
|
24 |
+
"tie_word_embeddings": true,
|
25 |
+
"torch_dtype": "float32",
|
26 |
+
"transformers_version": "4.42.4",
|
27 |
+
"use_cache": true,
|
28 |
+
"vocab_size": 4000
|
29 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bos_token_id": 1,
|
4 |
+
"eos_token_id": 2,
|
5 |
+
"transformers_version": "4.42.4"
|
6 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:03231736c84087bc4a26cce8818e53ec641adccaef3a300b765d40030dc8756d
|
3 |
+
size 36444280
|
special_tokens_map.json
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<|endoftext|>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "<|im_end|>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": {
|
17 |
+
"content": "<|endoftext|>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
}
|
23 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "<|endoftext|>",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"1": {
|
12 |
+
"content": "<|im_start|>",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"2": {
|
20 |
+
"content": "<|im_end|>",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
}
|
27 |
+
},
|
28 |
+
"bos_token": "<|endoftext|>",
|
29 |
+
"chat_template": "{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n' }}{% endif %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
|
30 |
+
"clean_up_tokenization_spaces": false,
|
31 |
+
"eos_token": "<|im_end|>",
|
32 |
+
"errors": "replace",
|
33 |
+
"model_max_length": 4096,
|
34 |
+
"pad_token": "<|endoftext|>",
|
35 |
+
"split_special_tokens": false,
|
36 |
+
"tokenizer_class": "PreTrainedTokenizerFast"
|
37 |
+
}
|