MaziyarPanahi commited on
Commit
7f4dc38
1 Parent(s): db03251

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - finetuned
4
+ - quantized
5
+ - 4-bit
6
+ - AWQ
7
+ - transformers
8
+ - pytorch
9
+ - llama
10
+ - text-generation
11
+ - Long Context
12
+ - en
13
+ - zh
14
+ - dataset:THUDM/LongAlign-10k
15
+ - arxiv:2401.18058
16
+ - license:apache-2.0
17
+ - autotrain_compatible
18
+ - endpoints_compatible
19
+ - text-generation-inference
20
+ - region:us
21
+ model_name: LongAlign-13B-64k-AWQ
22
+ base_model: THUDM/LongAlign-13B-64k
23
+ inference: false
24
+ model_creator: THUDM
25
+ pipeline_tag: text-generation
26
+ quantized_by: MaziyarPanahi
27
+ ---
28
+ # Description
29
+ [MaziyarPanahi/LongAlign-13B-64k-AWQ](https://huggingface.co/MaziyarPanahi/LongAlign-13B-64k-AWQ) is a quantized (AWQ) version of [THUDM/LongAlign-13B-64k](https://huggingface.co/THUDM/LongAlign-13B-64k)
30
+
31
+ ## How to use
32
+ ### Install the necessary packages
33
+
34
+ ```
35
+ pip install --upgrade accelerate autoawq transformers
36
+ ```
37
+
38
+ ### Example Python code
39
+
40
+
41
+ ```python
42
+ from transformers import AutoTokenizer, AutoModelForCausalLM
43
+
44
+ model_id = "MaziyarPanahi/LongAlign-13B-64k-AWQ"
45
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
46
+ model = AutoModelForCausalLM.from_pretrained(model_id).to(0)
47
+
48
+ text = "User:\nHello can you provide me with top-3 cool places to visit in Paris?\n\nAssistant:\n"
49
+ inputs = tokenizer(text, return_tensors="pt").to(0)
50
+
51
+ out = model.generate(**inputs, max_new_tokens=300)
52
+ print(tokenizer.decode(out[0], skip_special_tokens=True))
53
+ ```
54
+
55
+ Results:
56
+ ```
57
+ User:
58
+ Hello can you provide me with top-3 cool places to visit in Paris?
59
+
60
+ Assistant:
61
+ Absolutely, here are my top-3 recommendations for must-see places in Paris:
62
+
63
+ 1. The Eiffel Tower: An icon of Paris, this wrought-iron lattice tower is a global cultural icon of France and is among the most recognizable structures in the world. Climbing up to the top offers breathtaking views of the city.
64
+
65
+ 2. The Louvre Museum: Home to thousands of works of art, the Louvre is the world's largest art museum and a historic monument in Paris. Must-see pieces include the Mona Lisa, the Winged Victory of Samothrace, and the Venus de Milo.
66
+
67
+ 3. Notre-Dame Cathedral: This cathedral is a masterpiece of French Gothic architecture and is famous for its intricate stone carvings, beautiful stained glass, and its iconic twin towers. Be sure to spend some time exploring its history and learning about the fascinating restoration efforts post the 2019 fire.
68
+
69
+ I hope you find these recommendations helpful and that they make for an enjoyable and memorable trip to Paris. Safe travels!
70
+ ```
config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/home/maziyar/.cache/huggingface/hub/models--THUDM--LongAlign-13B-64k/snapshots/4bd5c5eba03d6f99fd346e264475eb7af535f36a",
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
+ "quantization_config": {
23
+ "bits": 4,
24
+ "group_size": 128,
25
+ "modules_to_not_convert": null,
26
+ "quant_method": "awq",
27
+ "version": "gemm",
28
+ "zero_point": true
29
+ },
30
+ "rms_norm_eps": 1e-05,
31
+ "rope_scaling": null,
32
+ "rope_theta": 2000000.0,
33
+ "tie_word_embeddings": false,
34
+ "torch_dtype": "float16",
35
+ "transformers_version": "4.38.0.dev0",
36
+ "use_cache": true,
37
+ "vocab_size": 32256
38
+ }
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 1,
3
+ "do_sample": true,
4
+ "eos_token_id": 2,
5
+ "max_length": 65536,
6
+ "pad_token_id": 0,
7
+ "temperature": 0.9,
8
+ "top_p": 0.6,
9
+ "transformers_version": "4.38.0.dev0"
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:75010b9dec81db4a233b80a9766a1deae33cd3b86d989f765a039095c4472ed0
3
+ size 7253230192
quant_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "zero_point": true,
3
+ "q_group_size": 128,
4
+ "w_bit": 4,
5
+ "version": "GEMM",
6
+ "modules_to_not_convert": null
7
+ }
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
+ }