Mxode commited on
Commit
ee96836
1 Parent(s): fbe1408

upload model

Browse files
README.md CHANGED
@@ -65,6 +65,7 @@ def translate(text: str, model, **kwargs):
65
  temperature = kwargs.pop("temperature", 0.55),
66
  top_p = kwargs.pop("top_p", 0.8),
67
  top_k = kwargs.pop("top_k", 40),
 
68
  **kwargs
69
  )
70
 
@@ -124,6 +125,6 @@ pipe = pipeline("text-generation", model=model_path, accelerator="ort")
124
 
125
  text = "I love to watch my favorite TV series."
126
 
127
- response = pipe(text, max_new_tokens=64, do_sample=False)
128
  response
129
  ```
 
65
  temperature = kwargs.pop("temperature", 0.55),
66
  top_p = kwargs.pop("top_p", 0.8),
67
  top_k = kwargs.pop("top_k", 40),
68
+ eos_token_id = kwargs.pop("eos_token_id", tokenizer.eos_token_id),
69
  **kwargs
70
  )
71
 
 
125
 
126
  text = "I love to watch my favorite TV series."
127
 
128
+ response = pipe(text, max_new_tokens=64, do_sample=False, eos_token_id=2)
129
  response
130
  ```
README_zh-CN.md CHANGED
@@ -53,6 +53,7 @@ def translate(text: str, model, **kwargs):
53
  temperature = kwargs.pop("temperature", 0.55),
54
  top_p = kwargs.pop("top_p", 0.8),
55
  top_k = kwargs.pop("top_k", 40),
 
56
  **kwargs
57
  )
58
 
@@ -98,7 +99,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_path)
98
 
99
  text = "I love to watch my favorite TV series."
100
 
101
- response = translate(text, ort_model, max_new_tokens=64, do_sample=False)
102
  print(response)
103
  ```
104
 
@@ -112,6 +113,6 @@ pipe = pipeline("text-generation", model=model_path, accelerator="ort")
112
 
113
  text = "I love to watch my favorite TV series."
114
 
115
- response = pipe(text, max_new_tokens=64, do_sample=False)
116
  response
117
  ```
 
53
  temperature = kwargs.pop("temperature", 0.55),
54
  top_p = kwargs.pop("top_p", 0.8),
55
  top_k = kwargs.pop("top_k", 40),
56
+ eos_token_id = kwargs.pop("eos_token_id", tokenizer.eos_token_id),
57
  **kwargs
58
  )
59
 
 
99
 
100
  text = "I love to watch my favorite TV series."
101
 
102
+ response = translate(text, ort_model, max_new_tokens=64, do_sample=False, eos_token_id=tokenizer.eos_token_id)
103
  print(response)
104
  ```
105
 
 
113
 
114
  text = "I love to watch my favorite TV series."
115
 
116
+ response = pipe(text, max_new_tokens=64, do_sample=False, eos_token_id=2)
117
  response
118
  ```
config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/mnt/bn/gmma/zxt/model/nt-m22",
3
+ "architectures": [
4
+ "Qwen2ForCausalLM"
5
+ ],
6
+ "attention_dropout": 0.0,
7
+ "hidden_act": "gelu",
8
+ "hidden_size": 432,
9
+ "initializer_range": 0.02,
10
+ "intermediate_size": 2304,
11
+ "max_position_embeddings": 1024,
12
+ "max_window_layers": 24,
13
+ "model_type": "qwen2",
14
+ "num_attention_heads": 24,
15
+ "num_hidden_layers": 6,
16
+ "num_key_value_heads": 8,
17
+ "rms_norm_eps": 1e-06,
18
+ "rope_theta": 10000.0,
19
+ "sliding_window": 4096,
20
+ "tie_word_embeddings": true,
21
+ "torch_dtype": "float32",
22
+ "transformers_version": "4.42.4",
23
+ "use_cache": true,
24
+ "use_sliding_window": false,
25
+ "vocab_size": 4000
26
+ }
generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 0,
4
+ "eos_token_id": 2,
5
+ "pad_token_id": 0,
6
+ "transformers_version": "4.42.4"
7
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a4329e7f733b180e2d0ca995fd2ca386fa0555a0bd555883f54f80761e484711
3
+ size 90567272
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": 1024,
34
+ "pad_token": "<|endoftext|>",
35
+ "split_special_tokens": false,
36
+ "tokenizer_class": "PreTrainedTokenizerFast"
37
+ }