NewBreaker
commited on
Commit
•
8ba09aa
1
Parent(s):
0076f81
auto git
Browse files- config.json +2 -2
- demo_call_api.py +10 -0
- demo_update_config.py +13 -0
config.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
{
|
2 |
"_name_or_path": "NewBreaker/chatglm-6b-int4",
|
3 |
"architectures": [
|
4 |
-
"
|
5 |
],
|
6 |
"auto_map": {
|
7 |
"AutoConfig": "configuration_chatglm.ChatGLMConfig",
|
@@ -18,7 +18,7 @@
|
|
18 |
"layernorm_epsilon": 1e-05,
|
19 |
"max_sequence_length": 2048,
|
20 |
"model_type": "chatglm",
|
21 |
-
"num_attention_heads":
|
22 |
"num_layers": 28,
|
23 |
"position_encoding_2d": true,
|
24 |
"quantization_bit": 4,
|
|
|
1 |
{
|
2 |
"_name_or_path": "NewBreaker/chatglm-6b-int4",
|
3 |
"architectures": [
|
4 |
+
"Question Answering task"
|
5 |
],
|
6 |
"auto_map": {
|
7 |
"AutoConfig": "configuration_chatglm.ChatGLMConfig",
|
|
|
18 |
"layernorm_epsilon": 1e-05,
|
19 |
"max_sequence_length": 2048,
|
20 |
"model_type": "chatglm",
|
21 |
+
"num_attention_heads": 36,
|
22 |
"num_layers": 28,
|
23 |
"position_encoding_2d": true,
|
24 |
"quantization_bit": 4,
|
demo_call_api.py
CHANGED
@@ -2,3 +2,13 @@ from transformers import AutoModel,AutoTokenizer
|
|
2 |
|
3 |
model = AutoModel.from_pretrained("NewBreaker/chatglm-6b-int4",trust_remote_code=True)
|
4 |
tokenizer = AutoTokenizer.from_pretrained("NewBreaker/chatglm-6b-int4", trust_remote_code=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
model = AutoModel.from_pretrained("NewBreaker/chatglm-6b-int4",trust_remote_code=True)
|
4 |
tokenizer = AutoTokenizer.from_pretrained("NewBreaker/chatglm-6b-int4", trust_remote_code=True)
|
5 |
+
|
6 |
+
from transformers import AutoConfig
|
7 |
+
|
8 |
+
config = AutoConfig.from_pretrained("bert-base-cased")
|
9 |
+
|
10 |
+
# Push the config to your namespace with the name "my-finetuned-bert".
|
11 |
+
config.push_to_hub("my-finetuned-bert")
|
12 |
+
|
13 |
+
# Push the config to an organization with the name "my-finetuned-bert".
|
14 |
+
config.push_to_hub("huggingface/my-finetuned-bert")
|
demo_update_config.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
from transformers import AutoConfig
|
3 |
+
|
4 |
+
config = AutoConfig.from_pretrained(".\\",trust_remote_code=True)
|
5 |
+
print("config:", config)
|
6 |
+
|
7 |
+
# 将配置推送到名为“my-finetuned-bert”的命名空间。
|
8 |
+
config.push_to_hub( "NewBreaker/chatglm-6b-int4" )
|
9 |
+
|
10 |
+
config = AutoConfig.from_pretrained("NewBreaker/chatglm-6b-int4",trust_remote_code=True)
|
11 |
+
print("config:", config)
|
12 |
+
|
13 |
+
|