Upload folder using huggingface_hub (#1)
Browse files- 96b6f1f65d4a1a5ba591f944f15f71f0b96b13d0d64ca8eb98f68402c0a14390 (beaaf26e6b3ce82523c6f9b3bbabc90b4e0ff37d)
- c83d5811cbb9541bdb160ded8ef84799d71412f4d333b4d065acb1892087841c (bf0fcac757abe7d2b0a8c864396dff7ccae3de6e)
- 581a6ac57810db168324572067a0ecb8e1817ae7d07dc548b2188e797fb4150f (9756d32d7dd3f77e46d62198ddbbd880c05beb26)
- 710307a1ec176f277c236b283017b85668f3dc76f5845929abdff84be7c12375 (a25ecd38815732f55297e687bec0366ebaf4d05c)
- 4d9caf9c25cbccf16e9e2ae335875513c4e51a89d21a6bdda0785aeb80faf909 (c9857c67cc6041da38d717088cf6356932523dcf)
- 416f20ef521cd0a2ce7994ecb1155f042ce06509ca1f3375ebf0fbf740307bae (b88f66e28b6867f88985fb145e6b09a0f025a301)
- b6a0577d3f548be5b6b322aca7c3b23f0a835c6333f7d2defe95f4daa3dc8701 (010341d063b1169a406e9e4b53284ec4678b3e31)
- f7ca71a5e09752031b4f5b48f46ce68bd19565d7728a837cad34d1dc76756157 (5aa60b4abd48b813edd504dc8a57332ef792d50f)
- 09558a7d3761fcd145c6df8ed1618b587872057f729bb3f7aa682957d9aa62b0 (38e093874b428f81562df89ef708959a020ed215)
- b2ed8b771322bf8cada8d45ca5772b2ed15fca901bbe39c02db36cf8a324a5e5 (01c66a7acb1998a236426450374e9c39f3e6fa9f)
- a2dded8e754d7ed505c2b4331b5c02a9b2f75fb7f6b720f54827b0c1844ccf97 (5f8235ef21ea7b48881df84e06a031227bf34ec9)
- 80d905e8600df742338754eb9e6a59f6f23617e21107d19fefb1f009fe3e8e69 (e6aa828c186742803bfc397b5024a288a5781811)
- bac15a669b687fdcd12523ef8c2b5994e78603f6d032eb5d540f0b90222b7f34 (232898484cfabd6c48098d41a706cd07fd7a15ed)
- 093345ed64ccc62ae7c9407f7f2fce1c32051ab39744f11a7ed4fc8a0508224e (d338ab695fb6ef60658c0b0f79023e87138f4a92)
- README.md +37 -0
- config.json +29 -0
- model-00001-of-00014.safetensors +3 -0
- model-00002-of-00014.safetensors +3 -0
- model-00003-of-00014.safetensors +3 -0
- model-00004-of-00014.safetensors +3 -0
- model-00005-of-00014.safetensors +3 -0
- model-00006-of-00014.safetensors +3 -0
- model-00007-of-00014.safetensors +3 -0
- model-00008-of-00014.safetensors +3 -0
- model-00009-of-00014.safetensors +3 -0
- model-00010-of-00014.safetensors +3 -0
- model-00011-of-00014.safetensors +3 -0
- model-00012-of-00014.safetensors +3 -0
- model-00013-of-00014.safetensors +3 -0
- model-00014-of-00014.safetensors +3 -0
- model.safetensors.index.json +0 -0
- special_tokens_map.json +23 -0
- test.py +26 -0
- tokenizer.json +0 -0
- tokenizer.model +3 -0
- tokenizer_config.json +0 -0
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
- fr
|
5 |
+
- de
|
6 |
+
- es
|
7 |
+
- it
|
8 |
+
- pt
|
9 |
+
- zh
|
10 |
+
- ja
|
11 |
+
- ru
|
12 |
+
- ko
|
13 |
+
license: other
|
14 |
+
tags:
|
15 |
+
- mlx
|
16 |
+
license_name: mrl
|
17 |
+
license_link: https://mistral.ai/licenses/MRL-0.1.md
|
18 |
+
extra_gated_description: If you want to learn more about how we process your personal
|
19 |
+
data, please read our <a href="https://mistral.ai/terms/">Privacy Policy</a>.
|
20 |
+
---
|
21 |
+
|
22 |
+
# mlx-community/Mistral-Large-Instruct-2407-4bit
|
23 |
+
|
24 |
+
The Model [mlx-community/Mistral-Large-Instruct-2407-4bit](https://huggingface.co/mlx-community/Mistral-Large-Instruct-2407-4bit) was converted to MLX format from [mistralai/Mistral-Large-Instruct-2407](https://huggingface.co/mistralai/Mistral-Large-Instruct-2407) using mlx-lm version **0.16.1**.
|
25 |
+
|
26 |
+
## Use with mlx
|
27 |
+
|
28 |
+
```bash
|
29 |
+
pip install mlx-lm
|
30 |
+
```
|
31 |
+
|
32 |
+
```python
|
33 |
+
from mlx_lm import load, generate
|
34 |
+
|
35 |
+
model, tokenizer = load("mlx-community/Mistral-Large-Instruct-2407-4bit")
|
36 |
+
response = generate(model, tokenizer, prompt="hello", verbose=True)
|
37 |
+
```
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"MistralForCausalLM"
|
4 |
+
],
|
5 |
+
"attention_dropout": 0.0,
|
6 |
+
"bos_token_id": 1,
|
7 |
+
"eos_token_id": 2,
|
8 |
+
"hidden_act": "silu",
|
9 |
+
"hidden_size": 12288,
|
10 |
+
"initializer_range": 0.02,
|
11 |
+
"intermediate_size": 28672,
|
12 |
+
"max_position_embeddings": 32768,
|
13 |
+
"model_type": "mistral",
|
14 |
+
"num_attention_heads": 96,
|
15 |
+
"num_hidden_layers": 88,
|
16 |
+
"num_key_value_heads": 8,
|
17 |
+
"quantization": {
|
18 |
+
"group_size": 64,
|
19 |
+
"bits": 4
|
20 |
+
},
|
21 |
+
"rms_norm_eps": 1e-05,
|
22 |
+
"rope_theta": 1000000.0,
|
23 |
+
"sliding_window": null,
|
24 |
+
"tie_word_embeddings": false,
|
25 |
+
"torch_dtype": "bfloat16",
|
26 |
+
"transformers_version": "4.42.3",
|
27 |
+
"use_cache": true,
|
28 |
+
"vocab_size": 32768
|
29 |
+
}
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d7a2ca3b4704cd052e1ff2e51debaf2c1e8152c65bf8f4cd6c76c1c937532a48
|
3 |
+
size 5280417162
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9a8682119076809870897a2f19e2521f0f4f8286cb56e329b412b18f984d7b12
|
3 |
+
size 5252155094
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ae72c583260c6994e799fff83973c096a88eedaaa72822793221826a6eeb6df0
|
3 |
+
size 5365401350
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5aa62c510112093c6a95db568b2506220dc0de5da85162f891f681e282f467bd
|
3 |
+
size 5351244918
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ed987234622b145c3363b65da174b21b5fdac6c3f9e603c399c17025951a46c2
|
3 |
+
size 5252105792
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d241878e33e1451d465f91652210a3713f221754bdb22c91e6e228d8f4363441
|
3 |
+
size 5252155193
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:252e43cb13a1451380ee8a0314e0e37df435d75c70acc56e1cc202caf6ca3615
|
3 |
+
size 5252155185
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0091033c2d48b2febeefb3ddcc86e913d4c6f94dc121e52304d06b6c6f95d77e
|
3 |
+
size 5365401388
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5d2e2865f0e5ddf526b86317e996c55b2a57b2b99febf1a8aa443e99eefc7a19
|
3 |
+
size 5351244930
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d0d7d7193be28007579409dcf123c605a33c7dc02e5fe7349a5e8d9a9a141b69
|
3 |
+
size 5252105824
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6a0014cf77c2effc79f2ad43f0580effb2083e2315efcfe8a024d87765be329d
|
3 |
+
size 5252155169
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:aad725bb51c8122e498d68b5a04bacc7dc66cf0f22876916d2a47515c65e76a8
|
3 |
+
size 5252155163
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ed1ce4cd8ce45ebc1c92701a1bed4a93f2e03853a763a2692f0fbd184d330a88
|
3 |
+
size 5266334543
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:198cbecacff88979c85cd838d22ff087a5ec71274b839ac28be808e9ff58934e
|
3 |
+
size 226492716
|
The diff for this file is too large to render.
See raw diff
|
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"unk_token": {
|
17 |
+
"content": "<unk>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
}
|
23 |
+
}
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
from typing import Dict
|
3 |
+
|
4 |
+
from safetensors.torch import load_file, save_file
|
5 |
+
from huggingface_hub import split_torch_state_dict_into_shards
|
6 |
+
import torch
|
7 |
+
import os
|
8 |
+
|
9 |
+
def save_state_dict(state_dict: Dict[str, torch.Tensor], save_directory: str):
|
10 |
+
state_dict_split = split_torch_state_dict_into_shards(state_dict, filename_pattern='consolidated{suffix}.safetensors')
|
11 |
+
for filename, tensors in state_dict_split.filename_to_tensors.items():
|
12 |
+
shard = {tensor: state_dict[tensor] for tensor in tensors}
|
13 |
+
print("Saving", save_directory, filename)
|
14 |
+
save_file(shard, os.path.join(save_directory, filename))
|
15 |
+
if state_dict_split.is_sharded:
|
16 |
+
index = {
|
17 |
+
"metadata": state_dict_split.metadata,
|
18 |
+
"weight_map": state_dict_split.tensor_to_filename,
|
19 |
+
}
|
20 |
+
with open(os.path.join(save_directory, "consolidated.safetensors.index.json"), "w") as f:
|
21 |
+
f.write(json.dumps(index, indent=2))
|
22 |
+
|
23 |
+
big_file = 'consolidated.safetensors'
|
24 |
+
loaded = load_file(big_file)
|
25 |
+
|
26 |
+
save_state_dict(loaded, save_directory=f'.')
|
The diff for this file is too large to render.
See raw diff
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:59f95e28944c062244741268596badc900df86c7f5ded05088d2da22a7379e06
|
3 |
+
size 587583
|
The diff for this file is too large to render.
See raw diff
|
|