yujiepan commited on
Commit
02ba5c6
·
verified ·
1 Parent(s): bd9afc9

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. README.md +2 -1
  2. config.json +1 -1
  3. model.safetensors +2 -2
README.md CHANGED
@@ -76,7 +76,7 @@ with open(hf_hub_download(source_model_id, filename='config.json', repo_type='mo
76
  config_json = json.load(f)
77
  config_json.update({
78
  "head_dim": 32,
79
- "hidden_size": 16,
80
  "intermediate_size": 64,
81
  "layer_types": ["sliding_attention", "full_attention"],
82
  "num_attention_heads": 2,
@@ -106,6 +106,7 @@ with torch.no_grad():
106
  model.save_pretrained(save_folder)
107
 
108
  # mxfp4
 
109
  # model = AutoModelForCausalLM.from_pretrained(save_folder, trust_remote_code=True, torch_dtype=torch.bfloat16, quantization_config=quantization_config)
110
  # model.save_pretrained(save_folder, safe_serialization=True)
111
  ```
 
76
  config_json = json.load(f)
77
  config_json.update({
78
  "head_dim": 32,
79
+ "hidden_size": 32, # required by Mxfp4GptOssExperts codes
80
  "intermediate_size": 64,
81
  "layer_types": ["sliding_attention", "full_attention"],
82
  "num_attention_heads": 2,
 
106
  model.save_pretrained(save_folder)
107
 
108
  # mxfp4
109
+ from transformers.quantizers.quantizer_mxfp4 import Mxfp4HfQuantizer
110
  # model = AutoModelForCausalLM.from_pretrained(save_folder, trust_remote_code=True, torch_dtype=torch.bfloat16, quantization_config=quantization_config)
111
  # model.save_pretrained(save_folder, safe_serialization=True)
112
  ```
config.json CHANGED
@@ -8,7 +8,7 @@
8
  "experts_per_token": 4,
9
  "head_dim": 32,
10
  "hidden_act": "silu",
11
- "hidden_size": 16,
12
  "initial_context_length": 4096,
13
  "initializer_range": 0.02,
14
  "intermediate_size": 64,
 
8
  "experts_per_token": 4,
9
  "head_dim": 32,
10
  "hidden_act": "silu",
11
+ "hidden_size": 32,
12
  "initial_context_length": 4096,
13
  "initializer_range": 0.02,
14
  "intermediate_size": 64,
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:304de707ed9cbe5bc3a7e574bb7da85f7afcbb9733cb39ada46200a17b740308
3
- size 6865464
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aefe8b9c4b4969f6d13c5d778760f3dce4e25134324b33677934550d9df02a7c
3
+ size 13710176