Panchovix commited on
Commit
1ae0fbc
·
verified ·
1 Parent(s): d58d9d5

Upload 15 files

Browse files
config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "rms_norm_eps": 1e-05,
18
+ "rope_theta": 1000000.0,
19
+ "sliding_window": null,
20
+ "tie_word_embeddings": false,
21
+ "torch_dtype": "bfloat16",
22
+ "transformers_version": "4.42.3",
23
+ "use_cache": true,
24
+ "vocab_size": 32768
25
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": 2,
5
+ "transformers_version": "4.42.3"
6
+ }
output-00001-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:555e2cfc9a1b4fb29cf92d1e651f05477b6c3c7770f4a4f586fbcbff967c3c29
3
+ size 8578360014
output-00002-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d0e766d1165a4f18b24fa192b25928622899e5794e70381b1a9f37e778ef8b7
3
+ size 8454161966
output-00003-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b5d2ed1fd5995593746bdc62594d2b227c2dbd82c0363488e05baee3e9696797
3
+ size 8482966348
output-00004-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a22231800254be6b17f6d63f4887b49477e7375ea32e901f8ce0dca720146fb9
3
+ size 8437961732
output-00005-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3015907b5905e56241a2867b5afe06a5203af4309475b1024af04a00feb8fd0f
3
+ size 8586745704
output-00006-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e989c55fb4b2199d829df25dbe203b2863c4a2377d5678a0d6a5aadb0a6dfeef
3
+ size 8550993000
output-00007-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a567fe629ac087fce04b81c868d580ccfd013aee679128bd7beed69aceecb7d3
3
+ size 8429247308
output-00008-of-00008.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40cd4b935e2a919fe3f379b0bbf16fc4edf27f3fa736ad1bb76098bd279a4e77
3
+ size 2504344804
params.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dim": 12288,
3
+ "n_layers": 88,
4
+ "head_dim": 128,
5
+ "hidden_dim": 28672,
6
+ "n_heads": 96,
7
+ "n_kv_heads": 8,
8
+ "norm_eps": 1e-05,
9
+ "vocab_size": 32768,
10
+ "rope_theta": 1000000.0
11
+ }
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.v3 ADDED
Binary file (588 kB). View file
 
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff