awni commited on
Commit
538703f
·
verified ·
1 Parent(s): 4600375

d7f9a0ac912167b210a795767556ec8086526af8d88ea62eda87c27b0b813f93

Browse files
README.md ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: deepseek-ai/DeepSeek-V3
3
+ tags:
4
+ - mlx
5
+ ---
6
+
7
+ # mlx-community/DeepSeek-V3-3bit
8
+
9
+ The Model [mlx-community/DeepSeek-V3-3bit](https://huggingface.co/mlx-community/DeepSeek-V3-3bit) was
10
+ converted to MLX format from [deepseek-ai/DeepSeek-V3](https://huggingface.co/deepseek-ai/DeepSeek-V3)
11
+ using mlx-lm version **0.20.4**.
12
+
13
+ ## Use with mlx
14
+
15
+ ```bash
16
+ pip install mlx-lm
17
+ ```
18
+
19
+ ```python
20
+ from mlx_lm import load, generate
21
+
22
+ model, tokenizer = load("mlx-community/DeepSeek-V3-3bit")
23
+
24
+ prompt="hello"
25
+
26
+ if tokenizer.chat_template is not None:
27
+ messages = [{"role": "user", "content": prompt}]
28
+ prompt = tokenizer.apply_chat_template(
29
+ messages, add_generation_prompt=True
30
+ )
31
+
32
+ response = generate(model, tokenizer, prompt=prompt, verbose=True)
33
+ ```
config.json ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "DeepseekV3ForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "auto_map": {
8
+ "AutoConfig": "configuration_deepseek.DeepseekV3Config",
9
+ "AutoModel": "modeling_deepseek.DeepseekV3Model",
10
+ "AutoModelForCausalLM": "modeling_deepseek.DeepseekV3ForCausalLM"
11
+ },
12
+ "aux_loss_alpha": 0.001,
13
+ "bos_token_id": 0,
14
+ "eos_token_id": 1,
15
+ "ep_size": 1,
16
+ "first_k_dense_replace": 3,
17
+ "hidden_act": "silu",
18
+ "hidden_size": 7168,
19
+ "initializer_range": 0.02,
20
+ "intermediate_size": 18432,
21
+ "kv_lora_rank": 512,
22
+ "max_position_embeddings": 163840,
23
+ "model_type": "deepseek_v3",
24
+ "moe_intermediate_size": 2048,
25
+ "moe_layer_freq": 1,
26
+ "n_group": 8,
27
+ "n_routed_experts": 256,
28
+ "n_shared_experts": 1,
29
+ "norm_topk_prob": true,
30
+ "num_attention_heads": 128,
31
+ "num_experts_per_tok": 8,
32
+ "num_hidden_layers": 61,
33
+ "num_key_value_heads": 128,
34
+ "num_nextn_predict_layers": 1,
35
+ "pretraining_tp": 1,
36
+ "q_lora_rank": 1536,
37
+ "qk_nope_head_dim": 128,
38
+ "qk_rope_head_dim": 64,
39
+ "quantization": {
40
+ "group_size": 32,
41
+ "bits": 3
42
+ },
43
+ "quantization_config": {
44
+ "group_size": 32,
45
+ "bits": 3
46
+ },
47
+ "rms_norm_eps": 1e-06,
48
+ "rope_scaling": {
49
+ "beta_fast": 32,
50
+ "beta_slow": 1,
51
+ "factor": 40,
52
+ "mscale": 1.0,
53
+ "mscale_all_dim": 1.0,
54
+ "original_max_position_embeddings": 4096,
55
+ "type": "yarn"
56
+ },
57
+ "rope_theta": 10000,
58
+ "routed_scaling_factor": 2.5,
59
+ "scoring_func": "sigmoid",
60
+ "seq_aux": true,
61
+ "tie_word_embeddings": false,
62
+ "topk_group": 4,
63
+ "topk_method": "noaux_tc",
64
+ "torch_dtype": "bfloat16",
65
+ "transformers_version": "4.33.1",
66
+ "use_cache": true,
67
+ "v_head_dim": 128,
68
+ "vocab_size": 129280
69
+ }
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
special_tokens_map.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|begin▁of▁sentence|>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|end▁of▁sentence|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<|end▁of▁sentence|>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ }
23
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff