Commit
·
45cb7a0
1
Parent(s):
3129ec8
add questions all
Browse files- config.json +26 -20
- demo_call_api.py +8 -0
- tokenizer_config.json +1 -1
config.json
CHANGED
@@ -1,24 +1,30 @@
|
|
1 |
{
|
|
|
2 |
"architectures": [
|
3 |
-
"
|
4 |
],
|
5 |
-
"
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
"
|
11 |
-
"
|
12 |
-
"
|
13 |
-
"
|
14 |
-
"
|
15 |
-
"
|
16 |
-
"
|
17 |
-
"
|
18 |
-
"
|
19 |
-
"
|
20 |
-
"
|
21 |
-
"
|
22 |
-
"
|
23 |
-
"
|
|
|
|
|
|
|
|
|
|
|
24 |
}
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "THUDM/chatglm-6b-int4",
|
3 |
"architectures": [
|
4 |
+
"ChatGLMModel"
|
5 |
],
|
6 |
+
"auto_map": {
|
7 |
+
"AutoConfig": "configuration_chatglm.ChatGLMConfig",
|
8 |
+
"AutoModel": "modeling_chatglm.ChatGLMForConditionalGeneration",
|
9 |
+
"AutoModelForSeq2SeqLM": "modeling_chatglm.ChatGLMForConditionalGeneration"
|
10 |
+
},
|
11 |
+
"bos_token_id": 130004,
|
12 |
+
"eos_token_id": 130005,
|
13 |
+
"mask_token_id": 130000,
|
14 |
+
"gmask_token_id": 130001,
|
15 |
+
"pad_token_id": 3,
|
16 |
+
"hidden_size": 4096,
|
17 |
+
"inner_hidden_size": 16384,
|
18 |
+
"layernorm_epsilon": 1e-05,
|
19 |
+
"max_sequence_length": 2048,
|
20 |
+
"model_type": "chatglm",
|
21 |
+
"num_attention_heads": 32,
|
22 |
+
"num_layers": 28,
|
23 |
+
"position_encoding_2d": true,
|
24 |
+
"quantization_bit": 4,
|
25 |
+
"quantization_embeddings": false,
|
26 |
+
"torch_dtype": "float16",
|
27 |
+
"transformers_version": "4.27.1",
|
28 |
+
"use_cache": true,
|
29 |
+
"vocab_size": 130528
|
30 |
}
|
demo_call_api.py
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
from transformers import AutoTokenizer, AutoModelForQuestionAnswering
|
3 |
+
|
4 |
+
tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b-int4")
|
5 |
+
|
6 |
+
model = AutoModelForQuestionAnswering.from_pretrained("THUDM/chatglm-6b-int4")
|
7 |
+
|
8 |
+
|
tokenizer_config.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"name_or_path": "
|
3 |
"bos_token": "<sop>",
|
4 |
"eos_token": "<eop>",
|
5 |
"end_token": "</s>",
|
|
|
1 |
{
|
2 |
+
"name_or_path": "THUDM/chatglm-6b-int4",
|
3 |
"bos_token": "<sop>",
|
4 |
"eos_token": "<eop>",
|
5 |
"end_token": "</s>",
|