Upload folder using huggingface_hub
Browse files- README.md +4 -7
- config.json +3 -3
README.md
CHANGED
|
@@ -126,17 +126,14 @@ model.model.ngram_embeddings = None # avoid saving shared params
|
|
| 126 |
model.save_pretrained(save_folder)
|
| 127 |
torch.set_default_dtype(torch.float32)
|
| 128 |
|
| 129 |
-
print(model.model.rotary_emb.inv_freq.shape)
|
| 130 |
-
# 1 / 0
|
| 131 |
-
# for n, m in model.named_modules():
|
| 132 |
-
# if 'LongcatFlashMLA' in str(type(m)):
|
| 133 |
-
# print(n, m.layer_idx)
|
| 134 |
-
|
| 135 |
with open(f"{save_folder}/config.json", "r", encoding='utf-8') as f:
|
| 136 |
config_json = json.load(f)
|
| 137 |
-
config_json['auto_map'] = {k:
|
|
|
|
| 138 |
with open(f"{save_folder}/config.json", "w", encoding='utf-8') as f:
|
| 139 |
json.dump(config_json, f, indent=2)
|
|
|
|
|
|
|
| 140 |
```
|
| 141 |
|
| 142 |
</details>
|
|
|
|
| 126 |
model.save_pretrained(save_folder)
|
| 127 |
torch.set_default_dtype(torch.float32)
|
| 128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
with open(f"{save_folder}/config.json", "r", encoding='utf-8') as f:
|
| 130 |
config_json = json.load(f)
|
| 131 |
+
config_json['auto_map'] = {k: source_model_id + '--' +
|
| 132 |
+
v.split('--')[-1] for k, v in config_json['auto_map'].items()}
|
| 133 |
with open(f"{save_folder}/config.json", "w", encoding='utf-8') as f:
|
| 134 |
json.dump(config_json, f, indent=2)
|
| 135 |
+
for f in Path(save_folder).glob('*.py'):
|
| 136 |
+
f.unlink()
|
| 137 |
```
|
| 138 |
|
| 139 |
</details>
|
config.json
CHANGED
|
@@ -5,9 +5,9 @@
|
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
"auto_map": {
|
| 8 |
-
"AutoConfig": "configuration_longcat_ngram.LongcatFlashNgramConfig",
|
| 9 |
-
"AutoModel": "modeling_longcat_ngram.LongcatFlashNgramModel",
|
| 10 |
-
"AutoModelForCausalLM": "modeling_longcat_ngram.LongcatFlashNgramForCausalLM"
|
| 11 |
},
|
| 12 |
"bos_token_id": 1,
|
| 13 |
"dtype": "bfloat16",
|
|
|
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
"auto_map": {
|
| 8 |
+
"AutoConfig": "meituan-longcat/LongCat-Flash-Lite--configuration_longcat_ngram.LongcatFlashNgramConfig",
|
| 9 |
+
"AutoModel": "meituan-longcat/LongCat-Flash-Lite--modeling_longcat_ngram.LongcatFlashNgramModel",
|
| 10 |
+
"AutoModelForCausalLM": "meituan-longcat/LongCat-Flash-Lite--modeling_longcat_ngram.LongcatFlashNgramForCausalLM"
|
| 11 |
},
|
| 12 |
"bos_token_id": 1,
|
| 13 |
"dtype": "bfloat16",
|