qnguyen3 commited on
Commit
c4884f9
1 Parent(s): e6666af

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - vi
4
+ license: afl-3.0
5
+ library_name: transformers
6
+ tags:
7
+ - LLMs
8
+ - NLP
9
+ - Vietnamese
10
+ - Large Language Models
11
+ - mlx
12
+ extra_gated_prompt: You agree not to use the model for experiments that could harm
13
+ human subjects.
14
+ extra_gated_fields:
15
+ Name: text
16
+ Email: text
17
+ Affiliation: text
18
+ Country: text
19
+ I agree to the LICENSE of this model: checkbox
20
+ ---
21
+
22
+ # Viet-Mistral/Vistral-7B-Chat-mlx-4bit
23
+ This model was converted to MLX format from [`Viet-Mistral/Vistral-7B-Chat`]().
24
+ Refer to the [original model card](https://huggingface.co/Viet-Mistral/Vistral-7B-Chat) for more details on the model.
25
+ ## Use with mlx
26
+
27
+ ```bash
28
+ pip install mlx-lm
29
+ ```
30
+
31
+ ```python
32
+ from mlx_lm import load, generate
33
+
34
+ model, tokenizer = load("Viet-Mistral/Vistral-7B-Chat-mlx-4bit")
35
+ response = generate(model, tokenizer, prompt="hello", verbose=True)
36
+ ```
added_tokens.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "<</SYS>>": 38366,
3
+ "<<SYS>>": 38365,
4
+ "[/INST]": 38368,
5
+ "[INST]": 38367
6
+ }
config.json ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "vocab_size": 38369,
3
+ "max_position_embeddings": 32768,
4
+ "hidden_size": 4096,
5
+ "intermediate_size": 14336,
6
+ "num_hidden_layers": 32,
7
+ "num_attention_heads": 32,
8
+ "sliding_window": 4096,
9
+ "num_key_value_heads": 8,
10
+ "hidden_act": "silu",
11
+ "initializer_range": 0.02,
12
+ "rms_norm_eps": 1e-05,
13
+ "use_cache": true,
14
+ "rope_theta": 10000.0,
15
+ "attention_dropout": 0.0,
16
+ "return_dict": true,
17
+ "output_hidden_states": false,
18
+ "output_attentions": false,
19
+ "torchscript": false,
20
+ "torch_dtype": "bfloat16",
21
+ "use_bfloat16": false,
22
+ "tf_legacy_loss": false,
23
+ "pruned_heads": {},
24
+ "tie_word_embeddings": false,
25
+ "chunk_size_feed_forward": 0,
26
+ "is_encoder_decoder": false,
27
+ "is_decoder": false,
28
+ "cross_attention_hidden_size": null,
29
+ "add_cross_attention": false,
30
+ "tie_encoder_decoder": false,
31
+ "max_length": 20,
32
+ "min_length": 0,
33
+ "do_sample": false,
34
+ "early_stopping": false,
35
+ "num_beams": 1,
36
+ "num_beam_groups": 1,
37
+ "diversity_penalty": 0.0,
38
+ "temperature": 1.0,
39
+ "top_k": 50,
40
+ "top_p": 1.0,
41
+ "typical_p": 1.0,
42
+ "repetition_penalty": 1.0,
43
+ "length_penalty": 1.0,
44
+ "no_repeat_ngram_size": 0,
45
+ "encoder_no_repeat_ngram_size": 0,
46
+ "bad_words_ids": null,
47
+ "num_return_sequences": 1,
48
+ "output_scores": false,
49
+ "return_dict_in_generate": false,
50
+ "forced_bos_token_id": null,
51
+ "forced_eos_token_id": null,
52
+ "remove_invalid_values": false,
53
+ "exponential_decay_length_penalty": null,
54
+ "suppress_tokens": null,
55
+ "begin_suppress_tokens": null,
56
+ "architectures": [
57
+ "MistralForCausalLM"
58
+ ],
59
+ "finetuning_task": null,
60
+ "id2label": {
61
+ "0": "LABEL_0",
62
+ "1": "LABEL_1"
63
+ },
64
+ "label2id": {
65
+ "LABEL_0": 0,
66
+ "LABEL_1": 1
67
+ },
68
+ "tokenizer_class": null,
69
+ "prefix": null,
70
+ "bos_token_id": 1,
71
+ "pad_token_id": null,
72
+ "eos_token_id": 2,
73
+ "sep_token_id": null,
74
+ "decoder_start_token_id": null,
75
+ "task_specific_params": null,
76
+ "problem_type": null,
77
+ "_name_or_path": "/Users/qnguyen3/.cache/huggingface/hub/models--Viet-Mistral--Vistral-7B-Chat/snapshots/87de56b5cdcdf743b5c5908c868849d09e552bc5",
78
+ "transformers_version": "4.37.2",
79
+ "model_type": "mistral",
80
+ "quantization": {
81
+ "group_size": 64,
82
+ "bits": 4
83
+ }
84
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:624b043071c36a1e6575013b5ac38a5a013c84d9521c1666e9c677def91d34f5
3
+ size 4329206080
special_tokens_map.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<unk>",
4
+ "<s>",
5
+ "</s>"
6
+ ],
7
+ "bos_token": {
8
+ "content": "<s>",
9
+ "lstrip": false,
10
+ "normalized": false,
11
+ "rstrip": false,
12
+ "single_word": false
13
+ },
14
+ "eos_token": {
15
+ "content": "</s>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false
20
+ },
21
+ "pad_token": {
22
+ "content": "<unk>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false
27
+ },
28
+ "unk_token": {
29
+ "content": "<unk>",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false
34
+ }
35
+ }
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:e792a804bbfc19a96b61b87109b8f2b0b7c92830025f285b402ba27c0c309c6f
3
+ size 596883
tokenizer_config.json ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "38365": {
30
+ "content": "<<SYS>>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": false
36
+ },
37
+ "38366": {
38
+ "content": "<</SYS>>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": false
44
+ },
45
+ "38367": {
46
+ "content": "[INST]",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": false
52
+ },
53
+ "38368": {
54
+ "content": "[/INST]",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": false
60
+ }
61
+ },
62
+ "additional_special_tokens": [
63
+ "<unk>",
64
+ "<s>",
65
+ "</s>"
66
+ ],
67
+ "bos_token": "<s>",
68
+ "chat_template": "{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% else %}{% set loop_messages = messages %}{% set system_message = false %}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if loop.index0 == 0 and system_message != false %}{% set content = '<<SYS>>\\n' + system_message + '\\n<</SYS>>\\n\\n' + message['content'] %}{% else %}{% set content = message['content'] %}{% endif %}{% if message['role'] == 'user' %}{{ bos_token + '[INST] ' + content.strip() + ' [/INST]' }}{% elif message['role'] == 'assistant' %}{{ ' ' + content.strip() + ' ' + eos_token }}{% endif %}{% endfor %}",
69
+ "clean_up_tokenization_spaces": false,
70
+ "eos_token": "</s>",
71
+ "legacy": true,
72
+ "model_max_length": 1000000000000000019884624838656,
73
+ "pad_token": "<unk>",
74
+ "sp_model_kwargs": {},
75
+ "spaces_between_special_tokens": false,
76
+ "tokenizer_class": "LlamaTokenizer",
77
+ "unk_token": "<unk>",
78
+ "use_default_system_prompt": false,
79
+ "use_fast": true
80
+ }