MaziyarPanahi
commited on
Commit
•
579d12e
1
Parent(s):
dccc2b2
Upload folder using huggingface_hub
Browse files- README.md +75 -0
- config.json +30 -0
- model.safetensors +3 -0
- quantize_config.json +11 -0
- special_tokens_map.json +30 -0
- tokenizer.json +0 -0
- tokenizer.model +3 -0
- tokenizer_config.json +41 -0
README.md
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
tags:
|
4 |
+
- finetuned
|
5 |
+
- quantized
|
6 |
+
- 4-bit
|
7 |
+
- gptq
|
8 |
+
- transformers
|
9 |
+
- pytorch
|
10 |
+
- llama
|
11 |
+
- text-generation
|
12 |
+
- Long Context
|
13 |
+
- en
|
14 |
+
- zh
|
15 |
+
- dataset:THUDM/LongAlign-10k
|
16 |
+
- arxiv:2401.18058
|
17 |
+
- license:apache-2.0
|
18 |
+
- autotrain_compatible
|
19 |
+
- endpoints_compatible
|
20 |
+
- text-generation-inference
|
21 |
+
- region:us
|
22 |
+
model_name: LongAlign-13B-64k-GPTQ
|
23 |
+
base_model: THUDM/LongAlign-13B-64k
|
24 |
+
inference: false
|
25 |
+
model_creator: THUDM
|
26 |
+
pipeline_tag: text-generation
|
27 |
+
quantized_by: MaziyarPanahi
|
28 |
+
---
|
29 |
+
# Description
|
30 |
+
[MaziyarPanahi/LongAlign-13B-64k-GPTQ](https://huggingface.co/MaziyarPanahi/LongAlign-13B-64k-GPTQ) is a quantized (GPTQ) version of [THUDM/LongAlign-13B-64k](https://huggingface.co/THUDM/LongAlign-13B-64k)
|
31 |
+
|
32 |
+
## How to use
|
33 |
+
### Install the necessary packages
|
34 |
+
|
35 |
+
```
|
36 |
+
pip install --upgrade accelerate auto-gptq transformers
|
37 |
+
```
|
38 |
+
|
39 |
+
### Example Python code
|
40 |
+
|
41 |
+
|
42 |
+
```python
|
43 |
+
from transformers import AutoTokenizer, pipeline
|
44 |
+
from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
|
45 |
+
import torch
|
46 |
+
|
47 |
+
model_id = "MaziyarPanahi/LongAlign-13B-64k-GPTQ"
|
48 |
+
|
49 |
+
quantize_config = BaseQuantizeConfig(
|
50 |
+
bits=4,
|
51 |
+
group_size=128,
|
52 |
+
desc_act=False
|
53 |
+
)
|
54 |
+
|
55 |
+
model = AutoGPTQForCausalLM.from_quantized(
|
56 |
+
model_id,
|
57 |
+
use_safetensors=True,
|
58 |
+
device="cuda:0",
|
59 |
+
quantize_config=quantize_config)
|
60 |
+
|
61 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
62 |
+
|
63 |
+
pipe = pipeline(
|
64 |
+
"text-generation",
|
65 |
+
model=model,
|
66 |
+
tokenizer=tokenizer,
|
67 |
+
max_new_tokens=512,
|
68 |
+
temperature=0.7,
|
69 |
+
top_p=0.95,
|
70 |
+
repetition_penalty=1.1
|
71 |
+
)
|
72 |
+
|
73 |
+
outputs = pipe("What is a large language model?")
|
74 |
+
print(outputs[0]["generated_text"])
|
75 |
+
```
|
config.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "THUDM/LongAlign-13B-64k",
|
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": 5120,
|
12 |
+
"initializer_range": 0.02,
|
13 |
+
"intermediate_size": 13824,
|
14 |
+
"max_position_embeddings": 65536,
|
15 |
+
"max_sequence_length": 65536,
|
16 |
+
"model_type": "llama",
|
17 |
+
"num_attention_heads": 40,
|
18 |
+
"num_hidden_layers": 40,
|
19 |
+
"num_key_value_heads": 40,
|
20 |
+
"pad_token_id": 0,
|
21 |
+
"pretraining_tp": 1,
|
22 |
+
"rms_norm_eps": 1e-05,
|
23 |
+
"rope_scaling": null,
|
24 |
+
"rope_theta": 2000000.0,
|
25 |
+
"tie_word_embeddings": false,
|
26 |
+
"torch_dtype": "float16",
|
27 |
+
"transformers_version": "4.36.2",
|
28 |
+
"use_cache": true,
|
29 |
+
"vocab_size": 32256
|
30 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0c9377c546c0fc3dc87cea9210462d506022e7d30eb188b74ba9e471569069a9
|
3 |
+
size 7264678072
|
quantize_config.json
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bits": 4,
|
3 |
+
"group_size": 128,
|
4 |
+
"damp_percent": 0.1,
|
5 |
+
"desc_act": false,
|
6 |
+
"static_groups": false,
|
7 |
+
"sym": true,
|
8 |
+
"true_sequential": true,
|
9 |
+
"model_name_or_path": null,
|
10 |
+
"model_file_base_name": null
|
11 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "</s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": {
|
17 |
+
"content": "<unk>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"unk_token": {
|
24 |
+
"content": "<unk>",
|
25 |
+
"lstrip": false,
|
26 |
+
"normalized": false,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
}
|
30 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
|
3 |
+
size 499723
|
tokenizer_config.json
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": true,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"added_tokens_decoder": {
|
5 |
+
"0": {
|
6 |
+
"content": "<unk>",
|
7 |
+
"lstrip": false,
|
8 |
+
"normalized": false,
|
9 |
+
"rstrip": false,
|
10 |
+
"single_word": false,
|
11 |
+
"special": true
|
12 |
+
},
|
13 |
+
"1": {
|
14 |
+
"content": "<s>",
|
15 |
+
"lstrip": false,
|
16 |
+
"normalized": false,
|
17 |
+
"rstrip": false,
|
18 |
+
"single_word": false,
|
19 |
+
"special": true
|
20 |
+
},
|
21 |
+
"2": {
|
22 |
+
"content": "</s>",
|
23 |
+
"lstrip": false,
|
24 |
+
"normalized": false,
|
25 |
+
"rstrip": false,
|
26 |
+
"single_word": false,
|
27 |
+
"special": true
|
28 |
+
}
|
29 |
+
},
|
30 |
+
"bos_token": "<s>",
|
31 |
+
"clean_up_tokenization_spaces": false,
|
32 |
+
"eos_token": "</s>",
|
33 |
+
"legacy": false,
|
34 |
+
"model_max_length": 65536,
|
35 |
+
"pad_token": "<unk>",
|
36 |
+
"padding_side": "right",
|
37 |
+
"sp_model_kwargs": {},
|
38 |
+
"tokenizer_class": "LlamaTokenizer",
|
39 |
+
"unk_token": "<unk>",
|
40 |
+
"use_default_system_prompt": false
|
41 |
+
}
|