prince-canuma commited on
Commit
ed1397f
1 Parent(s): ef76e4c

Upload folder using huggingface_hub (#1)

Browse files

- 67fa854c7999aa9451b2b3092496d42b74ccc5d0227143b5bdbc27a04867aee8 (64c919d8888ce39e0d08ef32ba2bb907c091124f)
- ea2c869f9a0e0bf97c57e8750f2f1106242c3eafae68ce0f6736038f95fd049f (fd121b0cb18006a49e39ddb3ccb12d481daed46c)
- 4ab60380a35cf8afa190ca070b21bf9cfe064879d38e6c52bfb4c70b14f09917 (9edf0666dc72847bf4b7a3c7902e018c37d1a7a7)
- ba6a306d81d5e20935f14b0d25a7caf2cef6b1a2d8abb257ef0885bc18107466 (8294d50f9c44090d577c7c63d98b65be2303906e)
- 26b7adba0ffd4f524f703bbfe941af1dee87a7ac157f7a0adfa459a0355052c1 (44ac0a639b39ead3a141d570a013773ff2b0fb29)
- 24452aa6ed7765651a04923e0a994a8a2763380f39a5950bc079e3a8e032313a (adeee47c977e52a83e0b25720ab70731ac9d7093)
- e92bab3bc43ba852699a109ef49fb443f34bc14fb01f63879f59fe3a564a5ae0 (ff6d1cf0c874d533d0561797c866dc2bf516ffd3)
- 2efd8a53d77f1a0fa23afd593c284dd5d44c7dfd31c1c73d38e7a194e65edcac (1d2b7c7f345e5bd29f02308238ef7c5b54e595e3)
- ee3e0b90e07b4cf64a054873c938e74ec375de77954fd76fdd0cc258b6ea9517 (a2053cf14819e2d4eea711fe285fa3087c5b3b90)
- 611b929cb25599b8efff75a4e86dc3a4e5c53630304d9b868c8baebfe133d306 (b178ce62733d15fefc797d7f574b16f525263460)
- 63e6231c76d330d66bbb1d34e57639156da4b93339ce9d4d714c9101cedf29e0 (f854cbb4f11139e1b9940e2b9c83523b1592e1c5)
- 290d18ccfdb51f2477c9d46f08f3a00e69ac35cf1c985b440ac61828138d242f (37059ca3d77adbaecb42fc18660e6e26bd29bc3a)
- 10f2707f43e939cf857bf4949981a488f3d632c8d3d6fee5b66213088ff2d05b (44bb2abafd2a33a75fe6397def4880cb94900c9e)
- 743f7f533a6e27f151ab93c891442b2cbe779babff0681ddd24aeabdc1d944be (8d0dbfa7ef9d2da23c2e6c14d8c43b4773a08bff)
- 874145c35dc711635404d95a2c8eaa444450e51ffa7785aeb6b94ca7b2367cc0 (e230ac8998fbdd6fb92119bf3e360cf60fe7241c)
- d608b82401930565fb489f3684614477fd04a113cc464b57d17d7054193446e3 (5fb44c594dadbf9d68c38ad0772af8fd0053f701)
- c3ccd5a60b40e963955ebc478d4eccfc60374c10d8d236c1163b5bbb3987da99 (cdcd3c2136f820dfdc57cdfaad5b2d61c035f585)
- 287b220edc75f808ce45e64a71ff0b1e958155114744c594ab99f7ae70902916 (9910c07771353ad08dae4cd965c0c668758467c7)
- 5013d20dcd53f745abba40098fe6b67c891861b57ba9c99ac968f4cdb7053ea1 (3cb68d9ba77782fbd70390f89e435fc63587bf65)
- bd0044f4ef694f952a91938190d5b0226facfd55c78b908d02a854e701295ac3 (6e6e259d90c57b34576411230d3a55498b8b2187)
- 4489f8404993433638cad7f7244f765231d8e1fcdb38281130d852bfb77d0d2a (ee9acabead70d9cf1d54362dabaf4014c127593c)
- 5e331aea5c675624df376f11a8571ebc936a9a43449900caea4d307eddf439a7 (8403dce13584807f0695ec5c092bc30d05518b05)
- db79f459103ec952ad576eb291ded7443efeaa423d016e29734f85858049b959 (4bcd07a7642032f80b57756f26fc9932d912524f)
- c0d3b91ce87dcefd09c09e91c2fea6da82e631c24b4bb8dfbcc526483ccc14fd (d11a80739ddcd1eb0c0e1fa852d38ab76425a319)
- 0737175322b3e94fae35c0a5e7c41e0e79fb576db30bdcba9745f27c7ba43c26 (35e58ddb2b3ba8a6bbf4379a23509cb1622d10cb)
- 2fe417b0c66e863889de0fa57962a2f483408e8bd16c5bae43129330e75f5015 (4cb1f0c90c5227dbf0ca510733e3c1f66abdb3ee)

README.md ADDED
@@ -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-8bit
23
+
24
+ The Model [mlx-community/Mistral-Large-Instruct-2407-8bit](https://huggingface.co/mlx-community/Mistral-Large-Instruct-2407-8bit) 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-8bit")
36
+ response = generate(model, tokenizer, prompt="hello", verbose=True)
37
+ ```
config.json ADDED
@@ -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": 8
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
+ }
model-00001-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b6fe80a964463f8a02a8641548c87643ae2f33564588bea016c0c4910ce7a332
3
+ size 5187462533
model-00002-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:212f1a67d0aa719bdc6ad95d2ca8fd21fc17d17eb7d9606b4c91af8f9b32990b
3
+ size 5160722815
model-00003-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2c3dd7adb3282aac8a7fd9142370e294875e2f267d79cbf8904f2a7434cb501b
3
+ size 5134034558
model-00004-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7e70aa9834c8b05c6b3a04ef0244747c44c0a0f7577b27f5a828f69acc43550e
3
+ size 5160722860
model-00005-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:600c328fc983a3a8b084e6df3a7198d2a86ff58b3683a376b1a8ae77e475aac6
3
+ size 5134034644
model-00006-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b4ea330c2ec9d1151af7c539e35c3ce0e9bd03374a1c86a87b3f4c1253f5df74
3
+ size 5160722866
model-00007-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8d36ca0c9b623d1398bf3ec3d7b37458f01c5b0676a9de9146ed92335f4d82c4
3
+ size 5134034640
model-00008-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64c0fe00f95deb023562c3028a2f415479bb93cddca4b8ee133976c2cf4a84c0
3
+ size 5160722906
model-00009-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d5e33d1495bb4b3ad5d2a8bd050dffb28e592e45371c303e9df6a200b74e429f
3
+ size 5134034638
model-00010-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a398aad235943301b1d106d2881505933cac1dcb1777aef59343b0886cb7a8a5
3
+ size 5160722878
model-00011-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4f52b27f556784be77ce6cc5905e105138e7ad58bd49baaa10df9046dcfd786b
3
+ size 5134034640
model-00012-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:324fecc8cdc9772a41b87ada2e1a88fe657856e805d53e45097361b711643a7e
3
+ size 5160722870
model-00013-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4f87ce77a0ea4a26207dd28773fc4c89213f61681d717237910c27e6acd3575
3
+ size 5134034648
model-00014-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f2d8392ec985065ec5774d6a3635248e6d7439f295c3e30a21a5e612804227a
3
+ size 5160722894
model-00015-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d6f6ee2e8d9c6618e175397fb3a25dbc012e984a4200b9481c0e362074320eca
3
+ size 5134034634
model-00016-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21de6179d856784fbe1088781894b6df4a0c1dc97b75ee0954de844b7cd9d79b
3
+ size 5160722894
model-00017-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a24eb5a55d9edefa16741a0817a7645ac7e501d0fae327bfc913e61b7502a3dc
3
+ size 5134034640
model-00018-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f866eb38f96b8fc7017856d9854ef09dea2c9ed333bc6be2c1ac9edcb97dbca8
3
+ size 5160722886
model-00019-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c20323c1fd999b838ceb1bf96d5d28ee8d6c5cf1b637c74e59751fdc27251ef
3
+ size 5134034642
model-00020-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b0280930e90bf0eef519208ce9b0e3f50c7f6e34a394b187c95f1fc88ce3022b
3
+ size 5160722886
model-00021-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f88921c970a349956a02c8ead0532c1938fb5260d9d170bd7bf8d3197a086ad7
3
+ size 5134034648
model-00022-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0ae3bd64e4e38985d40c52dfa2cc49d724647d931fec27c8f56448b23723a0a6
3
+ size 5160722902
model-00023-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8f32f9486306cf10b3b3ec37b0d4f06f73a2258054b4bc102073bccc8ed55417
3
+ size 5134034658
model-00024-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4cd7b6e834301b8ed493493582fcf07a8b30a03d2d118bc12aa14d6b09fdaaa5
3
+ size 5160722906
model-00025-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:35752200c588ac4cc0049fee1697eca85f9876215fdd2aabbd3814da6d66766a
3
+ size 5134034638
model-00026-of-00026.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b0bb18f2d891f92dce325f83e31f33d53400f7da7b9a13e23b6cad2e18fe040
3
+ size 1550919270
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": "<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
+ }
test.py ADDED
@@ -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'.')
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:59f95e28944c062244741268596badc900df86c7f5ded05088d2da22a7379e06
3
+ size 587583
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff