upload
Browse files- README.md +11 -10
- README_zh-CN.md +11 -10
- config.json +28 -0
- generation_config.json +6 -0
- model.safetensors +3 -0
- result.log +1 -0
- special_tokens_map.json +23 -0
- tokenizer.json +0 -0
- tokenizer_config.json +37 -0
- trainer_state.json +0 -0
README.md
CHANGED
@@ -22,13 +22,14 @@ All models are collected in the [NanoTranslator Collection](https://huggingface.
|
|
22 |
|
23 |
| | P. | Arch. | Act. | V. | H. | I. | L. | A.H. | K.H. | Tie |
|
24 |
| :--: | :-----: | :--: | :--: | :--: | :-----: | :---: | :------: | :--: | :--: | :--: |
|
25 |
-
|
|
26 |
-
| [
|
27 |
-
|
|
28 |
-
| [
|
29 |
-
|
|
30 |
-
| [
|
31 |
-
|
|
|
|
32 |
|
33 |
- **P.** - Parameters (in million)
|
34 |
- **V.** - vocab size
|
@@ -81,7 +82,7 @@ def translate(text: str, model, **kwargs):
|
|
81 |
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
82 |
return response
|
83 |
|
84 |
-
text = "
|
85 |
|
86 |
response = translate(text, model, max_new_tokens=64, do_sample=False)
|
87 |
print(response)
|
@@ -110,7 +111,7 @@ model_path = "your/folder/to/onnx_model"
|
|
110 |
ort_model = ORTModelForCausalLM.from_pretrained(model_path)
|
111 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
112 |
|
113 |
-
text = "
|
114 |
|
115 |
response = translate(text, ort_model, max_new_tokens=64, do_sample=False)
|
116 |
print(response)
|
@@ -124,7 +125,7 @@ from optimum.pipelines import pipeline
|
|
124 |
model_path = "your/folder/to/onnx_model"
|
125 |
pipe = pipeline("text-generation", model=model_path, accelerator="ort")
|
126 |
|
127 |
-
text = "
|
128 |
|
129 |
response = pipe(text, max_new_tokens=64, do_sample=False)
|
130 |
response
|
|
|
22 |
|
23 |
| | P. | Arch. | Act. | V. | H. | I. | L. | A.H. | K.H. | Tie |
|
24 |
| :--: | :-----: | :--: | :--: | :--: | :-----: | :---: | :------: | :--: | :--: | :--: |
|
25 |
+
| [XXL2](https://huggingface.co/Mxode/NanoTranslator-XXL2) | 102 | LLaMA | SwiGLU | 16K | 1120 | 3072 | 6 | 16 | 8 | True |
|
26 |
+
| [XXL](https://huggingface.co/Mxode/NanoTranslator-XXL) | 100 | LLaMA | SwiGLU | 16K | 768 | 4096 | 8 | 24 | 8 | True |
|
27 |
+
| [XL](https://huggingface.co/Mxode/NanoTranslator-XL) | 78 | LLaMA | GeGLU | 16K | 768 | 4096 | 6 | 24 | 8 | True |
|
28 |
+
| [L](https://huggingface.co/Mxode/NanoTranslator-L) | 49 | LLaMA | GeGLU | 16K | 512 | 2816 | 8 | 16 | 8 | True |
|
29 |
+
| [M2](https://huggingface.co/Mxode/NanoTranslator-M2) | 22 | Qwen2 | GeGLU | 4K | 432 | 2304 | 6 | 24 | 8 | True |
|
30 |
+
| [M](https://huggingface.co/Mxode/NanoTranslator-M) | 22 | LLaMA | SwiGLU | 8K | 256 | 1408 | 16 | 16 | 4 | True |
|
31 |
+
| [S](https://huggingface.co/Mxode/NanoTranslator-S) | 9 | LLaMA | SwiGLU | 4K | 168 | 896 | 16 | 12 | 4 | True |
|
32 |
+
| [XS](https://huggingface.co/Mxode/NanoTranslator-XS) | 2 | LLaMA | SwiGLU | 2K | 96 | 512 | 12 | 12 | 4 | True |
|
33 |
|
34 |
- **P.** - Parameters (in million)
|
35 |
- **V.** - vocab size
|
|
|
82 |
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
83 |
return response
|
84 |
|
85 |
+
text = "Each step of the cell cycle is monitored by internal."
|
86 |
|
87 |
response = translate(text, model, max_new_tokens=64, do_sample=False)
|
88 |
print(response)
|
|
|
111 |
ort_model = ORTModelForCausalLM.from_pretrained(model_path)
|
112 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
113 |
|
114 |
+
text = "Each step of the cell cycle is monitored by internal."
|
115 |
|
116 |
response = translate(text, ort_model, max_new_tokens=64, do_sample=False)
|
117 |
print(response)
|
|
|
125 |
model_path = "your/folder/to/onnx_model"
|
126 |
pipe = pipeline("text-generation", model=model_path, accelerator="ort")
|
127 |
|
128 |
+
text = "Each step of the cell cycle is monitored by internal."
|
129 |
|
130 |
response = pipe(text, max_new_tokens=64, do_sample=False)
|
131 |
response
|
README_zh-CN.md
CHANGED
@@ -10,13 +10,14 @@
|
|
10 |
|
11 |
| | P. | Arch. | Act. | V. | H. | I. | L. | A.H. | K.H. | Tie |
|
12 |
| :--: | :-----: | :--: | :--: | :--: | :-----: | :---: | :------: | :--: | :--: | :--: |
|
13 |
-
|
|
14 |
-
| [
|
15 |
-
|
|
16 |
-
| [
|
17 |
-
|
|
18 |
-
| [
|
19 |
-
|
|
|
|
20 |
|
21 |
- **P.** - Parameters (in million)
|
22 |
- **V.** - vocab size
|
@@ -69,7 +70,7 @@ def translate(text: str, model, **kwargs):
|
|
69 |
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
70 |
return response
|
71 |
|
72 |
-
text = "
|
73 |
|
74 |
response = translate(text, model, max_new_tokens=64, do_sample=False)
|
75 |
print(response)
|
@@ -98,7 +99,7 @@ model_path = "your/folder/to/onnx_model"
|
|
98 |
ort_model = ORTModelForCausalLM.from_pretrained(model_path)
|
99 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
100 |
|
101 |
-
text = "
|
102 |
|
103 |
response = translate(text, ort_model, max_new_tokens=64, do_sample=False)
|
104 |
print(response)
|
@@ -112,7 +113,7 @@ from optimum.pipelines import pipeline
|
|
112 |
model_path = "your/folder/to/onnx_model"
|
113 |
pipe = pipeline("text-generation", model=model_path, accelerator="ort")
|
114 |
|
115 |
-
text = "
|
116 |
|
117 |
response = pipe(text, max_new_tokens=64, do_sample=False)
|
118 |
response
|
|
|
10 |
|
11 |
| | P. | Arch. | Act. | V. | H. | I. | L. | A.H. | K.H. | Tie |
|
12 |
| :--: | :-----: | :--: | :--: | :--: | :-----: | :---: | :------: | :--: | :--: | :--: |
|
13 |
+
| [XXL2](https://huggingface.co/Mxode/NanoTranslator-XXL2) | 102 | LLaMA | SwiGLU | 16K | 1120 | 3072 | 6 | 16 | 8 | True |
|
14 |
+
| [XXL](https://huggingface.co/Mxode/NanoTranslator-XXL) | 100 | LLaMA | SwiGLU | 16K | 768 | 4096 | 8 | 24 | 8 | True |
|
15 |
+
| [XL](https://huggingface.co/Mxode/NanoTranslator-XL) | 78 | LLaMA | GeGLU | 16K | 768 | 4096 | 6 | 24 | 8 | True |
|
16 |
+
| [L](https://huggingface.co/Mxode/NanoTranslator-L) | 49 | LLaMA | GeGLU | 16K | 512 | 2816 | 8 | 16 | 8 | True |
|
17 |
+
| [M2](https://huggingface.co/Mxode/NanoTranslator-M2) | 22 | Qwen2 | GeGLU | 4K | 432 | 2304 | 6 | 24 | 8 | True |
|
18 |
+
| [M](https://huggingface.co/Mxode/NanoTranslator-M) | 22 | LLaMA | SwiGLU | 8K | 256 | 1408 | 16 | 16 | 4 | True |
|
19 |
+
| [S](https://huggingface.co/Mxode/NanoTranslator-S) | 9 | LLaMA | SwiGLU | 4K | 168 | 896 | 16 | 12 | 4 | True |
|
20 |
+
| [XS](https://huggingface.co/Mxode/NanoTranslator-XS) | 2 | LLaMA | SwiGLU | 2K | 96 | 512 | 12 | 12 | 4 | True |
|
21 |
|
22 |
- **P.** - Parameters (in million)
|
23 |
- **V.** - vocab size
|
|
|
70 |
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
71 |
return response
|
72 |
|
73 |
+
text = "Each step of the cell cycle is monitored by internal."
|
74 |
|
75 |
response = translate(text, model, max_new_tokens=64, do_sample=False)
|
76 |
print(response)
|
|
|
99 |
ort_model = ORTModelForCausalLM.from_pretrained(model_path)
|
100 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
101 |
|
102 |
+
text = "Each step of the cell cycle is monitored by internal."
|
103 |
|
104 |
response = translate(text, ort_model, max_new_tokens=64, do_sample=False)
|
105 |
print(response)
|
|
|
113 |
model_path = "your/folder/to/onnx_model"
|
114 |
pipe = pipeline("text-generation", model=model_path, accelerator="ort")
|
115 |
|
116 |
+
text = "Each step of the cell cycle is monitored by internal."
|
117 |
|
118 |
response = pipe(text, max_new_tokens=64, do_sample=False)
|
119 |
response
|
config.json
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"LlamaForCausalLM"
|
4 |
+
],
|
5 |
+
"attention_bias": false,
|
6 |
+
"attention_dropout": 0.0,
|
7 |
+
"bos_token_id": 1,
|
8 |
+
"eos_token_id": 2,
|
9 |
+
"hidden_act": "gelu",
|
10 |
+
"hidden_size": 768,
|
11 |
+
"initializer_range": 0.02,
|
12 |
+
"intermediate_size": 4096,
|
13 |
+
"max_position_embeddings": 2048,
|
14 |
+
"mlp_bias": false,
|
15 |
+
"model_type": "llama",
|
16 |
+
"num_attention_heads": 24,
|
17 |
+
"num_hidden_layers": 6,
|
18 |
+
"num_key_value_heads": 8,
|
19 |
+
"pretraining_tp": 1,
|
20 |
+
"rms_norm_eps": 1e-06,
|
21 |
+
"rope_scaling": null,
|
22 |
+
"rope_theta": 10000.0,
|
23 |
+
"tie_word_embeddings": true,
|
24 |
+
"torch_dtype": "float32",
|
25 |
+
"transformers_version": "4.42.4",
|
26 |
+
"use_cache": true,
|
27 |
+
"vocab_size": 16000
|
28 |
+
}
|
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:94ee24624f73c64cd22a0de31d7cb086e0eec99a98e1c7bd193e7ef77001cbff
|
3 |
+
size 313439280
|
result.log
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{'train_runtime': 12543.7806, 'train_samples_per_second': 1279.948, 'train_steps_per_second': 2.5, 'train_loss': 1.2199503767455795, 'epoch': 1.0}
|
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 |
+
}
|
trainer_state.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|