Upload folder using huggingface_hub
Browse files- Mistral-NeMo-12B-Instruct-HF/config.json +26 -0
- Mistral-NeMo-12B-Instruct-HF/convert_mistral_weights_to_hf.py +260 -0
- Mistral-NeMo-12B-Instruct-HF/generation_config.json +6 -0
- Mistral-NeMo-12B-Instruct-HF/model-00001-of-00005.safetensors +3 -0
- Mistral-NeMo-12B-Instruct-HF/model-00002-of-00005.safetensors +3 -0
- Mistral-NeMo-12B-Instruct-HF/model-00003-of-00005.safetensors +3 -0
- Mistral-NeMo-12B-Instruct-HF/model-00004-of-00005.safetensors +3 -0
- Mistral-NeMo-12B-Instruct-HF/model-00005-of-00005.safetensors +3 -0
- Mistral-NeMo-12B-Instruct-HF/model.safetensors.index.json +370 -0
- Mistral-NeMo-12B-Instruct-HF/run.py +32 -0
Mistral-NeMo-12B-Instruct-HF/config.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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": 5120,
|
| 10 |
+
"initializer_range": 0.02,
|
| 11 |
+
"intermediate_size": 14336,
|
| 12 |
+
"kv_channels": 128,
|
| 13 |
+
"max_position_embeddings": 1024000,
|
| 14 |
+
"model_type": "mistral",
|
| 15 |
+
"num_attention_heads": 32,
|
| 16 |
+
"num_hidden_layers": 40,
|
| 17 |
+
"num_key_value_heads": 8,
|
| 18 |
+
"rms_norm_eps": 1e-05,
|
| 19 |
+
"rope_theta": 1000000.0,
|
| 20 |
+
"sliding_window": null,
|
| 21 |
+
"tie_word_embeddings": false,
|
| 22 |
+
"torch_dtype": "bfloat16",
|
| 23 |
+
"transformers_version": "4.42.0.dev0",
|
| 24 |
+
"use_cache": true,
|
| 25 |
+
"vocab_size": 131072
|
| 26 |
+
}
|
Mistral-NeMo-12B-Instruct-HF/convert_mistral_weights_to_hf.py
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright 2023 Mistral AI and The HuggingFace Inc. team. All rights reserved.
|
| 2 |
+
#
|
| 3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
# you may not use this file except in compliance with the License.
|
| 5 |
+
# You may obtain a copy of the License at
|
| 6 |
+
#
|
| 7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
#
|
| 9 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
# See the License for the specific language governing permissions and
|
| 13 |
+
# limitations under the License.
|
| 14 |
+
import argparse
|
| 15 |
+
import gc
|
| 16 |
+
import json
|
| 17 |
+
import os
|
| 18 |
+
import shutil
|
| 19 |
+
import warnings
|
| 20 |
+
|
| 21 |
+
import torch
|
| 22 |
+
from safetensors.torch import load_file as safe_load_file
|
| 23 |
+
|
| 24 |
+
from transformers import (
|
| 25 |
+
LlamaTokenizer,
|
| 26 |
+
MistralConfig,
|
| 27 |
+
MistralForCausalLM,
|
| 28 |
+
)
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
try:
|
| 32 |
+
from transformers import LlamaTokenizerFast
|
| 33 |
+
|
| 34 |
+
tokenizer_class = LlamaTokenizerFast
|
| 35 |
+
except ImportError as e:
|
| 36 |
+
warnings.warn(e)
|
| 37 |
+
warnings.warn(
|
| 38 |
+
"The converted tokenizer will be the `slow` tokenizer. To use the fast, update your `tokenizers` library and re-run the tokenizer conversion"
|
| 39 |
+
)
|
| 40 |
+
tokenizer_class = LlamaTokenizer
|
| 41 |
+
|
| 42 |
+
"""
|
| 43 |
+
Sample usage:
|
| 44 |
+
|
| 45 |
+
```
|
| 46 |
+
python src/transformers/models/mistral/convert_mistral_weights_to_hf.py \
|
| 47 |
+
--input_dir /path/to/downloaded/mistral/weights --model_size 7B --output_dir /output/path
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
Thereafter, models can be loaded via:
|
| 51 |
+
|
| 52 |
+
```py
|
| 53 |
+
from transformers import MistralForCausalLM, LlamaTokenizer
|
| 54 |
+
|
| 55 |
+
model = MistralForCausalLM.from_pretrained("/output/path")
|
| 56 |
+
tokenizer = LlamaTokenizer.from_pretrained("/output/path")
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
Important note: you need to be able to host the whole model in RAM to execute this script (even if the biggest versions
|
| 60 |
+
come in several checkpoints they each contain a part of each weight of the model, so we need to load them all in RAM).
|
| 61 |
+
"""
|
| 62 |
+
|
| 63 |
+
NUM_SHARDS = {"7B": 1}
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def compute_intermediate_size(n, ffn_dim_multiplier=1, multiple_of=256):
|
| 67 |
+
return multiple_of * ((int(ffn_dim_multiplier * int(8 * n / 3)) + multiple_of - 1) // multiple_of)
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
def read_json(path):
|
| 71 |
+
with open(path, "r") as f:
|
| 72 |
+
return json.load(f)
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
def write_json(text, path):
|
| 76 |
+
with open(path, "w") as f:
|
| 77 |
+
json.dump(text, f)
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
def write_model(model_path, input_base_path, safe_serialization=True, is_v3=False):
|
| 81 |
+
# for backward compatibility, before you needed the repo to be called `my_repo/model_size`
|
| 82 |
+
os.makedirs(model_path, exist_ok=True)
|
| 83 |
+
tmp_model_path = os.path.join(model_path, "tmp")
|
| 84 |
+
os.makedirs(tmp_model_path, exist_ok=True)
|
| 85 |
+
|
| 86 |
+
params = read_json(os.path.join(input_base_path, "params.json"))
|
| 87 |
+
num_shards = 1
|
| 88 |
+
|
| 89 |
+
n_layers = params["n_layers"]
|
| 90 |
+
n_heads = params["n_heads"]
|
| 91 |
+
n_heads_per_shard = n_heads // num_shards
|
| 92 |
+
dim = params["dim"]
|
| 93 |
+
dims_per_head = params["head_dim"]
|
| 94 |
+
base = params.get("rope_theta", 10000.0)
|
| 95 |
+
inv_freq = 1.0 / (base ** (torch.arange(0, dims_per_head, 2).float() / dims_per_head))
|
| 96 |
+
max_position_embeddings = 128000 * 8
|
| 97 |
+
|
| 98 |
+
vocab_size = params["vocab_size"]
|
| 99 |
+
|
| 100 |
+
if "n_kv_heads" in params:
|
| 101 |
+
num_key_value_heads = params["n_kv_heads"] # for GQA / MQA
|
| 102 |
+
num_local_key_value_heads = num_key_value_heads // num_shards
|
| 103 |
+
key_value_dim = dims_per_head * num_local_key_value_heads
|
| 104 |
+
|
| 105 |
+
# permute for sliced rotary
|
| 106 |
+
def permute(w, n_heads=n_heads, dim1=dims_per_head * n_heads, dim2=dim):
|
| 107 |
+
return w.view(n_heads, dim1 // n_heads // 2, 2, dim2).transpose(1, 2).reshape(dim1, dim2)
|
| 108 |
+
|
| 109 |
+
print(f"Fetching all parameters from the checkpoint at {input_base_path}.")
|
| 110 |
+
|
| 111 |
+
# Load weights - for v3 models the consolidated weights are in a single file format in safetensors
|
| 112 |
+
if is_v3:
|
| 113 |
+
loaded = [safe_load_file(os.path.join(input_base_path, "consolidated.safetensors"))]
|
| 114 |
+
else:
|
| 115 |
+
loaded = [
|
| 116 |
+
torch.load(os.path.join(input_base_path, f"consolidated.{i:02d}.pth"), map_location="cpu")
|
| 117 |
+
for i in range(num_shards)
|
| 118 |
+
]
|
| 119 |
+
param_count = 0
|
| 120 |
+
index_dict = {"weight_map": {}}
|
| 121 |
+
for layer_i in range(n_layers):
|
| 122 |
+
filename = f"pytorch_model-{layer_i + 1}-of-{n_layers + 1}.bin"
|
| 123 |
+
|
| 124 |
+
# Sharded
|
| 125 |
+
# Note that attention.w{q,k,v,o}, feed_fordward.w[1,2,3], attention_norm.weight and ffn_norm.weight share
|
| 126 |
+
# the same storage object, saving attention_norm and ffn_norm will save other weights too, which is
|
| 127 |
+
# redundant as other weights will be stitched from multiple shards. To avoid that, they are cloned.
|
| 128 |
+
|
| 129 |
+
state_dict = {
|
| 130 |
+
f"model.layers.{layer_i}.input_layernorm.weight": loaded[0][
|
| 131 |
+
f"layers.{layer_i}.attention_norm.weight"
|
| 132 |
+
].clone(),
|
| 133 |
+
f"model.layers.{layer_i}.post_attention_layernorm.weight": loaded[0][
|
| 134 |
+
f"layers.{layer_i}.ffn_norm.weight"
|
| 135 |
+
].clone(),
|
| 136 |
+
}
|
| 137 |
+
state_dict[f"model.layers.{layer_i}.self_attn.q_proj.weight"] = permute(
|
| 138 |
+
torch.cat(
|
| 139 |
+
[
|
| 140 |
+
loaded[i][f"layers.{layer_i}.attention.wq.weight"].view(n_heads_per_shard, dims_per_head, dim)
|
| 141 |
+
for i in range(num_shards)
|
| 142 |
+
],
|
| 143 |
+
dim=0,
|
| 144 |
+
).reshape(n_heads_per_shard * dims_per_head, dim)
|
| 145 |
+
)
|
| 146 |
+
state_dict[f"model.layers.{layer_i}.self_attn.k_proj.weight"] = permute(
|
| 147 |
+
torch.cat(
|
| 148 |
+
[
|
| 149 |
+
loaded[i][f"layers.{layer_i}.attention.wk.weight"].view(
|
| 150 |
+
num_local_key_value_heads, dims_per_head, dim
|
| 151 |
+
)
|
| 152 |
+
for i in range(num_shards)
|
| 153 |
+
],
|
| 154 |
+
dim=0,
|
| 155 |
+
).reshape(key_value_dim, dim),
|
| 156 |
+
num_key_value_heads,
|
| 157 |
+
key_value_dim,
|
| 158 |
+
dim,
|
| 159 |
+
)
|
| 160 |
+
state_dict[f"model.layers.{layer_i}.self_attn.v_proj.weight"] = torch.cat(
|
| 161 |
+
[
|
| 162 |
+
loaded[i][f"layers.{layer_i}.attention.wv.weight"].view(num_local_key_value_heads, dims_per_head, dim)
|
| 163 |
+
for i in range(num_shards)
|
| 164 |
+
],
|
| 165 |
+
dim=0,
|
| 166 |
+
).reshape(key_value_dim, dim)
|
| 167 |
+
|
| 168 |
+
state_dict[f"model.layers.{layer_i}.self_attn.o_proj.weight"] = torch.cat(
|
| 169 |
+
[loaded[i][f"layers.{layer_i}.attention.wo.weight"] for i in range(num_shards)], dim=1
|
| 170 |
+
)
|
| 171 |
+
state_dict[f"model.layers.{layer_i}.mlp.gate_proj.weight"] = torch.cat(
|
| 172 |
+
[loaded[i][f"layers.{layer_i}.feed_forward.w1.weight"] for i in range(num_shards)], dim=0
|
| 173 |
+
)
|
| 174 |
+
state_dict[f"model.layers.{layer_i}.mlp.down_proj.weight"] = torch.cat(
|
| 175 |
+
[loaded[i][f"layers.{layer_i}.feed_forward.w2.weight"] for i in range(num_shards)], dim=1
|
| 176 |
+
)
|
| 177 |
+
state_dict[f"model.layers.{layer_i}.mlp.up_proj.weight"] = torch.cat(
|
| 178 |
+
[loaded[i][f"layers.{layer_i}.feed_forward.w3.weight"] for i in range(num_shards)], dim=0
|
| 179 |
+
)
|
| 180 |
+
|
| 181 |
+
state_dict[f"model.layers.{layer_i}.self_attn.rotary_emb.inv_freq"] = inv_freq
|
| 182 |
+
for k, v in state_dict.items():
|
| 183 |
+
index_dict["weight_map"][k] = filename
|
| 184 |
+
param_count += v.numel()
|
| 185 |
+
torch.save(state_dict, os.path.join(tmp_model_path, filename))
|
| 186 |
+
|
| 187 |
+
filename = f"pytorch_model-{n_layers + 1}-of-{n_layers + 1}.bin"
|
| 188 |
+
state_dict = {
|
| 189 |
+
"model.norm.weight": loaded[0]["norm.weight"],
|
| 190 |
+
"model.embed_tokens.weight": torch.cat([loaded[i]["tok_embeddings.weight"] for i in range(num_shards)], dim=1),
|
| 191 |
+
"lm_head.weight": torch.cat([loaded[i]["output.weight"] for i in range(num_shards)], dim=0),
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
for k, v in state_dict.items():
|
| 195 |
+
index_dict["weight_map"][k] = filename
|
| 196 |
+
param_count += v.numel()
|
| 197 |
+
torch.save(state_dict, os.path.join(tmp_model_path, filename))
|
| 198 |
+
|
| 199 |
+
# Write configs
|
| 200 |
+
index_dict["metadata"] = {"total_size": param_count * 2}
|
| 201 |
+
write_json(index_dict, os.path.join(tmp_model_path, "pytorch_model.bin.index.json"))
|
| 202 |
+
config = MistralConfig(
|
| 203 |
+
hidden_size=dim,
|
| 204 |
+
intermediate_size=params["hidden_dim"],
|
| 205 |
+
num_attention_heads=params["n_heads"],
|
| 206 |
+
num_hidden_layers=params["n_layers"],
|
| 207 |
+
rms_norm_eps=params["norm_eps"],
|
| 208 |
+
kv_channels=params["head_dim"],
|
| 209 |
+
num_key_value_heads=num_key_value_heads,
|
| 210 |
+
vocab_size=vocab_size,
|
| 211 |
+
rope_theta=base,
|
| 212 |
+
max_position_embeddings=max_position_embeddings,
|
| 213 |
+
sliding_window=None,
|
| 214 |
+
)
|
| 215 |
+
config.save_pretrained(tmp_model_path)
|
| 216 |
+
|
| 217 |
+
# Make space so we can load the model properly now.
|
| 218 |
+
del state_dict
|
| 219 |
+
del loaded
|
| 220 |
+
gc.collect()
|
| 221 |
+
|
| 222 |
+
print("Loading the checkpoint in a Mistral model.")
|
| 223 |
+
model = MistralForCausalLM.from_pretrained(tmp_model_path, torch_dtype=torch.bfloat16)
|
| 224 |
+
# Avoid saving this as part of the config.
|
| 225 |
+
del model.config._name_or_path
|
| 226 |
+
model.config.torch_dtype = torch.float16
|
| 227 |
+
print("Saving in the Transformers format.")
|
| 228 |
+
|
| 229 |
+
model.save_pretrained(model_path, safe_serialization=safe_serialization)
|
| 230 |
+
shutil.rmtree(tmp_model_path)
|
| 231 |
+
|
| 232 |
+
|
| 233 |
+
def write_tokenizer(tokenizer_path, input_tokenizer_path):
|
| 234 |
+
# Initialize the tokenizer based on the `spm` model
|
| 235 |
+
print(f"Saving a {tokenizer_class.__name__} to {tokenizer_path}.")
|
| 236 |
+
tokenizer = tokenizer_class(input_tokenizer_path)
|
| 237 |
+
tokenizer.save_pretrained(tokenizer_path)
|
| 238 |
+
|
| 239 |
+
|
| 240 |
+
def main():
|
| 241 |
+
parser = argparse.ArgumentParser()
|
| 242 |
+
parser.add_argument(
|
| 243 |
+
"--input_dir",
|
| 244 |
+
help="Location of Mistral weights, which contains tokenizer.model and model folders",
|
| 245 |
+
)
|
| 246 |
+
parser.add_argument(
|
| 247 |
+
"--output_dir",
|
| 248 |
+
help="Location to write HF model and tokenizer",
|
| 249 |
+
)
|
| 250 |
+
args = parser.parse_args()
|
| 251 |
+
write_model(
|
| 252 |
+
model_path=args.output_dir,
|
| 253 |
+
input_base_path=args.input_dir,
|
| 254 |
+
safe_serialization=True,
|
| 255 |
+
is_v3=True,
|
| 256 |
+
)
|
| 257 |
+
|
| 258 |
+
|
| 259 |
+
if __name__ == "__main__":
|
| 260 |
+
main()
|
Mistral-NeMo-12B-Instruct-HF/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.0.dev0"
|
| 6 |
+
}
|
Mistral-NeMo-12B-Instruct-HF/model-00001-of-00005.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:37597b50c825674e56ff1b058f0d148b57dcbc1c39727b641a87ffbf247886ec
|
| 3 |
+
size 4865522496
|
Mistral-NeMo-12B-Instruct-HF/model-00002-of-00005.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cec7e36f1451270477569401d5c06af9df8f12da341ff446322796979a30d88b
|
| 3 |
+
size 4907529424
|
Mistral-NeMo-12B-Instruct-HF/model-00003-of-00005.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fd68cdd7584ed9bdb5d891cd72fe05abbb50b6ad2860d147786d27a15f764aaa
|
| 3 |
+
size 4907529456
|
Mistral-NeMo-12B-Instruct-HF/model-00004-of-00005.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:02a05716064ca298c767b7accf9aed9153f9e090eff4605b871de005ce7ce3a9
|
| 3 |
+
size 4907529456
|
Mistral-NeMo-12B-Instruct-HF/model-00005-of-00005.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f41f0dd6989345ad1f29d6ab341cbf965bec0954bd90884913ff4cb1b8cc8402
|
| 3 |
+
size 4907496272
|
Mistral-NeMo-12B-Instruct-HF/model.safetensors.index.json
ADDED
|
@@ -0,0 +1,370 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"metadata": {
|
| 3 |
+
"total_size": 24495564800
|
| 4 |
+
},
|
| 5 |
+
"weight_map": {
|
| 6 |
+
"lm_head.weight": "model-00005-of-00005.safetensors",
|
| 7 |
+
"model.embed_tokens.weight": "model-00001-of-00005.safetensors",
|
| 8 |
+
"model.layers.0.input_layernorm.weight": "model-00001-of-00005.safetensors",
|
| 9 |
+
"model.layers.0.mlp.down_proj.weight": "model-00001-of-00005.safetensors",
|
| 10 |
+
"model.layers.0.mlp.gate_proj.weight": "model-00001-of-00005.safetensors",
|
| 11 |
+
"model.layers.0.mlp.up_proj.weight": "model-00001-of-00005.safetensors",
|
| 12 |
+
"model.layers.0.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
|
| 13 |
+
"model.layers.0.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
|
| 14 |
+
"model.layers.0.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
|
| 15 |
+
"model.layers.0.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
|
| 16 |
+
"model.layers.0.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
|
| 17 |
+
"model.layers.1.input_layernorm.weight": "model-00001-of-00005.safetensors",
|
| 18 |
+
"model.layers.1.mlp.down_proj.weight": "model-00001-of-00005.safetensors",
|
| 19 |
+
"model.layers.1.mlp.gate_proj.weight": "model-00001-of-00005.safetensors",
|
| 20 |
+
"model.layers.1.mlp.up_proj.weight": "model-00001-of-00005.safetensors",
|
| 21 |
+
"model.layers.1.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
|
| 22 |
+
"model.layers.1.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
|
| 23 |
+
"model.layers.1.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
|
| 24 |
+
"model.layers.1.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
|
| 25 |
+
"model.layers.1.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
|
| 26 |
+
"model.layers.10.input_layernorm.weight": "model-00002-of-00005.safetensors",
|
| 27 |
+
"model.layers.10.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
|
| 28 |
+
"model.layers.10.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
|
| 29 |
+
"model.layers.10.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
|
| 30 |
+
"model.layers.10.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
|
| 31 |
+
"model.layers.10.self_attn.k_proj.weight": "model-00002-of-00005.safetensors",
|
| 32 |
+
"model.layers.10.self_attn.o_proj.weight": "model-00002-of-00005.safetensors",
|
| 33 |
+
"model.layers.10.self_attn.q_proj.weight": "model-00002-of-00005.safetensors",
|
| 34 |
+
"model.layers.10.self_attn.v_proj.weight": "model-00002-of-00005.safetensors",
|
| 35 |
+
"model.layers.11.input_layernorm.weight": "model-00002-of-00005.safetensors",
|
| 36 |
+
"model.layers.11.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
|
| 37 |
+
"model.layers.11.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
|
| 38 |
+
"model.layers.11.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
|
| 39 |
+
"model.layers.11.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
|
| 40 |
+
"model.layers.11.self_attn.k_proj.weight": "model-00002-of-00005.safetensors",
|
| 41 |
+
"model.layers.11.self_attn.o_proj.weight": "model-00002-of-00005.safetensors",
|
| 42 |
+
"model.layers.11.self_attn.q_proj.weight": "model-00002-of-00005.safetensors",
|
| 43 |
+
"model.layers.11.self_attn.v_proj.weight": "model-00002-of-00005.safetensors",
|
| 44 |
+
"model.layers.12.input_layernorm.weight": "model-00002-of-00005.safetensors",
|
| 45 |
+
"model.layers.12.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
|
| 46 |
+
"model.layers.12.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
|
| 47 |
+
"model.layers.12.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
|
| 48 |
+
"model.layers.12.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
|
| 49 |
+
"model.layers.12.self_attn.k_proj.weight": "model-00002-of-00005.safetensors",
|
| 50 |
+
"model.layers.12.self_attn.o_proj.weight": "model-00002-of-00005.safetensors",
|
| 51 |
+
"model.layers.12.self_attn.q_proj.weight": "model-00002-of-00005.safetensors",
|
| 52 |
+
"model.layers.12.self_attn.v_proj.weight": "model-00002-of-00005.safetensors",
|
| 53 |
+
"model.layers.13.input_layernorm.weight": "model-00002-of-00005.safetensors",
|
| 54 |
+
"model.layers.13.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
|
| 55 |
+
"model.layers.13.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
|
| 56 |
+
"model.layers.13.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
|
| 57 |
+
"model.layers.13.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
|
| 58 |
+
"model.layers.13.self_attn.k_proj.weight": "model-00002-of-00005.safetensors",
|
| 59 |
+
"model.layers.13.self_attn.o_proj.weight": "model-00002-of-00005.safetensors",
|
| 60 |
+
"model.layers.13.self_attn.q_proj.weight": "model-00002-of-00005.safetensors",
|
| 61 |
+
"model.layers.13.self_attn.v_proj.weight": "model-00002-of-00005.safetensors",
|
| 62 |
+
"model.layers.14.input_layernorm.weight": "model-00002-of-00005.safetensors",
|
| 63 |
+
"model.layers.14.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
|
| 64 |
+
"model.layers.14.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
|
| 65 |
+
"model.layers.14.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
|
| 66 |
+
"model.layers.14.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
|
| 67 |
+
"model.layers.14.self_attn.k_proj.weight": "model-00002-of-00005.safetensors",
|
| 68 |
+
"model.layers.14.self_attn.o_proj.weight": "model-00002-of-00005.safetensors",
|
| 69 |
+
"model.layers.14.self_attn.q_proj.weight": "model-00002-of-00005.safetensors",
|
| 70 |
+
"model.layers.14.self_attn.v_proj.weight": "model-00002-of-00005.safetensors",
|
| 71 |
+
"model.layers.15.input_layernorm.weight": "model-00003-of-00005.safetensors",
|
| 72 |
+
"model.layers.15.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
|
| 73 |
+
"model.layers.15.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
|
| 74 |
+
"model.layers.15.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
|
| 75 |
+
"model.layers.15.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
|
| 76 |
+
"model.layers.15.self_attn.k_proj.weight": "model-00002-of-00005.safetensors",
|
| 77 |
+
"model.layers.15.self_attn.o_proj.weight": "model-00002-of-00005.safetensors",
|
| 78 |
+
"model.layers.15.self_attn.q_proj.weight": "model-00002-of-00005.safetensors",
|
| 79 |
+
"model.layers.15.self_attn.v_proj.weight": "model-00002-of-00005.safetensors",
|
| 80 |
+
"model.layers.16.input_layernorm.weight": "model-00003-of-00005.safetensors",
|
| 81 |
+
"model.layers.16.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
|
| 82 |
+
"model.layers.16.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
|
| 83 |
+
"model.layers.16.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
|
| 84 |
+
"model.layers.16.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
|
| 85 |
+
"model.layers.16.self_attn.k_proj.weight": "model-00003-of-00005.safetensors",
|
| 86 |
+
"model.layers.16.self_attn.o_proj.weight": "model-00003-of-00005.safetensors",
|
| 87 |
+
"model.layers.16.self_attn.q_proj.weight": "model-00003-of-00005.safetensors",
|
| 88 |
+
"model.layers.16.self_attn.v_proj.weight": "model-00003-of-00005.safetensors",
|
| 89 |
+
"model.layers.17.input_layernorm.weight": "model-00003-of-00005.safetensors",
|
| 90 |
+
"model.layers.17.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
|
| 91 |
+
"model.layers.17.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
|
| 92 |
+
"model.layers.17.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
|
| 93 |
+
"model.layers.17.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
|
| 94 |
+
"model.layers.17.self_attn.k_proj.weight": "model-00003-of-00005.safetensors",
|
| 95 |
+
"model.layers.17.self_attn.o_proj.weight": "model-00003-of-00005.safetensors",
|
| 96 |
+
"model.layers.17.self_attn.q_proj.weight": "model-00003-of-00005.safetensors",
|
| 97 |
+
"model.layers.17.self_attn.v_proj.weight": "model-00003-of-00005.safetensors",
|
| 98 |
+
"model.layers.18.input_layernorm.weight": "model-00003-of-00005.safetensors",
|
| 99 |
+
"model.layers.18.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
|
| 100 |
+
"model.layers.18.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
|
| 101 |
+
"model.layers.18.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
|
| 102 |
+
"model.layers.18.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
|
| 103 |
+
"model.layers.18.self_attn.k_proj.weight": "model-00003-of-00005.safetensors",
|
| 104 |
+
"model.layers.18.self_attn.o_proj.weight": "model-00003-of-00005.safetensors",
|
| 105 |
+
"model.layers.18.self_attn.q_proj.weight": "model-00003-of-00005.safetensors",
|
| 106 |
+
"model.layers.18.self_attn.v_proj.weight": "model-00003-of-00005.safetensors",
|
| 107 |
+
"model.layers.19.input_layernorm.weight": "model-00003-of-00005.safetensors",
|
| 108 |
+
"model.layers.19.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
|
| 109 |
+
"model.layers.19.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
|
| 110 |
+
"model.layers.19.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
|
| 111 |
+
"model.layers.19.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
|
| 112 |
+
"model.layers.19.self_attn.k_proj.weight": "model-00003-of-00005.safetensors",
|
| 113 |
+
"model.layers.19.self_attn.o_proj.weight": "model-00003-of-00005.safetensors",
|
| 114 |
+
"model.layers.19.self_attn.q_proj.weight": "model-00003-of-00005.safetensors",
|
| 115 |
+
"model.layers.19.self_attn.v_proj.weight": "model-00003-of-00005.safetensors",
|
| 116 |
+
"model.layers.2.input_layernorm.weight": "model-00001-of-00005.safetensors",
|
| 117 |
+
"model.layers.2.mlp.down_proj.weight": "model-00001-of-00005.safetensors",
|
| 118 |
+
"model.layers.2.mlp.gate_proj.weight": "model-00001-of-00005.safetensors",
|
| 119 |
+
"model.layers.2.mlp.up_proj.weight": "model-00001-of-00005.safetensors",
|
| 120 |
+
"model.layers.2.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
|
| 121 |
+
"model.layers.2.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
|
| 122 |
+
"model.layers.2.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
|
| 123 |
+
"model.layers.2.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
|
| 124 |
+
"model.layers.2.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
|
| 125 |
+
"model.layers.20.input_layernorm.weight": "model-00003-of-00005.safetensors",
|
| 126 |
+
"model.layers.20.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
|
| 127 |
+
"model.layers.20.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
|
| 128 |
+
"model.layers.20.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
|
| 129 |
+
"model.layers.20.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
|
| 130 |
+
"model.layers.20.self_attn.k_proj.weight": "model-00003-of-00005.safetensors",
|
| 131 |
+
"model.layers.20.self_attn.o_proj.weight": "model-00003-of-00005.safetensors",
|
| 132 |
+
"model.layers.20.self_attn.q_proj.weight": "model-00003-of-00005.safetensors",
|
| 133 |
+
"model.layers.20.self_attn.v_proj.weight": "model-00003-of-00005.safetensors",
|
| 134 |
+
"model.layers.21.input_layernorm.weight": "model-00003-of-00005.safetensors",
|
| 135 |
+
"model.layers.21.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
|
| 136 |
+
"model.layers.21.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
|
| 137 |
+
"model.layers.21.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
|
| 138 |
+
"model.layers.21.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
|
| 139 |
+
"model.layers.21.self_attn.k_proj.weight": "model-00003-of-00005.safetensors",
|
| 140 |
+
"model.layers.21.self_attn.o_proj.weight": "model-00003-of-00005.safetensors",
|
| 141 |
+
"model.layers.21.self_attn.q_proj.weight": "model-00003-of-00005.safetensors",
|
| 142 |
+
"model.layers.21.self_attn.v_proj.weight": "model-00003-of-00005.safetensors",
|
| 143 |
+
"model.layers.22.input_layernorm.weight": "model-00003-of-00005.safetensors",
|
| 144 |
+
"model.layers.22.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
|
| 145 |
+
"model.layers.22.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
|
| 146 |
+
"model.layers.22.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
|
| 147 |
+
"model.layers.22.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
|
| 148 |
+
"model.layers.22.self_attn.k_proj.weight": "model-00003-of-00005.safetensors",
|
| 149 |
+
"model.layers.22.self_attn.o_proj.weight": "model-00003-of-00005.safetensors",
|
| 150 |
+
"model.layers.22.self_attn.q_proj.weight": "model-00003-of-00005.safetensors",
|
| 151 |
+
"model.layers.22.self_attn.v_proj.weight": "model-00003-of-00005.safetensors",
|
| 152 |
+
"model.layers.23.input_layernorm.weight": "model-00003-of-00005.safetensors",
|
| 153 |
+
"model.layers.23.mlp.down_proj.weight": "model-00003-of-00005.safetensors",
|
| 154 |
+
"model.layers.23.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
|
| 155 |
+
"model.layers.23.mlp.up_proj.weight": "model-00003-of-00005.safetensors",
|
| 156 |
+
"model.layers.23.post_attention_layernorm.weight": "model-00003-of-00005.safetensors",
|
| 157 |
+
"model.layers.23.self_attn.k_proj.weight": "model-00003-of-00005.safetensors",
|
| 158 |
+
"model.layers.23.self_attn.o_proj.weight": "model-00003-of-00005.safetensors",
|
| 159 |
+
"model.layers.23.self_attn.q_proj.weight": "model-00003-of-00005.safetensors",
|
| 160 |
+
"model.layers.23.self_attn.v_proj.weight": "model-00003-of-00005.safetensors",
|
| 161 |
+
"model.layers.24.input_layernorm.weight": "model-00004-of-00005.safetensors",
|
| 162 |
+
"model.layers.24.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
|
| 163 |
+
"model.layers.24.mlp.gate_proj.weight": "model-00003-of-00005.safetensors",
|
| 164 |
+
"model.layers.24.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
|
| 165 |
+
"model.layers.24.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
|
| 166 |
+
"model.layers.24.self_attn.k_proj.weight": "model-00003-of-00005.safetensors",
|
| 167 |
+
"model.layers.24.self_attn.o_proj.weight": "model-00003-of-00005.safetensors",
|
| 168 |
+
"model.layers.24.self_attn.q_proj.weight": "model-00003-of-00005.safetensors",
|
| 169 |
+
"model.layers.24.self_attn.v_proj.weight": "model-00003-of-00005.safetensors",
|
| 170 |
+
"model.layers.25.input_layernorm.weight": "model-00004-of-00005.safetensors",
|
| 171 |
+
"model.layers.25.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
|
| 172 |
+
"model.layers.25.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
|
| 173 |
+
"model.layers.25.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
|
| 174 |
+
"model.layers.25.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
|
| 175 |
+
"model.layers.25.self_attn.k_proj.weight": "model-00004-of-00005.safetensors",
|
| 176 |
+
"model.layers.25.self_attn.o_proj.weight": "model-00004-of-00005.safetensors",
|
| 177 |
+
"model.layers.25.self_attn.q_proj.weight": "model-00004-of-00005.safetensors",
|
| 178 |
+
"model.layers.25.self_attn.v_proj.weight": "model-00004-of-00005.safetensors",
|
| 179 |
+
"model.layers.26.input_layernorm.weight": "model-00004-of-00005.safetensors",
|
| 180 |
+
"model.layers.26.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
|
| 181 |
+
"model.layers.26.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
|
| 182 |
+
"model.layers.26.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
|
| 183 |
+
"model.layers.26.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
|
| 184 |
+
"model.layers.26.self_attn.k_proj.weight": "model-00004-of-00005.safetensors",
|
| 185 |
+
"model.layers.26.self_attn.o_proj.weight": "model-00004-of-00005.safetensors",
|
| 186 |
+
"model.layers.26.self_attn.q_proj.weight": "model-00004-of-00005.safetensors",
|
| 187 |
+
"model.layers.26.self_attn.v_proj.weight": "model-00004-of-00005.safetensors",
|
| 188 |
+
"model.layers.27.input_layernorm.weight": "model-00004-of-00005.safetensors",
|
| 189 |
+
"model.layers.27.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
|
| 190 |
+
"model.layers.27.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
|
| 191 |
+
"model.layers.27.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
|
| 192 |
+
"model.layers.27.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
|
| 193 |
+
"model.layers.27.self_attn.k_proj.weight": "model-00004-of-00005.safetensors",
|
| 194 |
+
"model.layers.27.self_attn.o_proj.weight": "model-00004-of-00005.safetensors",
|
| 195 |
+
"model.layers.27.self_attn.q_proj.weight": "model-00004-of-00005.safetensors",
|
| 196 |
+
"model.layers.27.self_attn.v_proj.weight": "model-00004-of-00005.safetensors",
|
| 197 |
+
"model.layers.28.input_layernorm.weight": "model-00004-of-00005.safetensors",
|
| 198 |
+
"model.layers.28.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
|
| 199 |
+
"model.layers.28.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
|
| 200 |
+
"model.layers.28.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
|
| 201 |
+
"model.layers.28.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
|
| 202 |
+
"model.layers.28.self_attn.k_proj.weight": "model-00004-of-00005.safetensors",
|
| 203 |
+
"model.layers.28.self_attn.o_proj.weight": "model-00004-of-00005.safetensors",
|
| 204 |
+
"model.layers.28.self_attn.q_proj.weight": "model-00004-of-00005.safetensors",
|
| 205 |
+
"model.layers.28.self_attn.v_proj.weight": "model-00004-of-00005.safetensors",
|
| 206 |
+
"model.layers.29.input_layernorm.weight": "model-00004-of-00005.safetensors",
|
| 207 |
+
"model.layers.29.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
|
| 208 |
+
"model.layers.29.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
|
| 209 |
+
"model.layers.29.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
|
| 210 |
+
"model.layers.29.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
|
| 211 |
+
"model.layers.29.self_attn.k_proj.weight": "model-00004-of-00005.safetensors",
|
| 212 |
+
"model.layers.29.self_attn.o_proj.weight": "model-00004-of-00005.safetensors",
|
| 213 |
+
"model.layers.29.self_attn.q_proj.weight": "model-00004-of-00005.safetensors",
|
| 214 |
+
"model.layers.29.self_attn.v_proj.weight": "model-00004-of-00005.safetensors",
|
| 215 |
+
"model.layers.3.input_layernorm.weight": "model-00001-of-00005.safetensors",
|
| 216 |
+
"model.layers.3.mlp.down_proj.weight": "model-00001-of-00005.safetensors",
|
| 217 |
+
"model.layers.3.mlp.gate_proj.weight": "model-00001-of-00005.safetensors",
|
| 218 |
+
"model.layers.3.mlp.up_proj.weight": "model-00001-of-00005.safetensors",
|
| 219 |
+
"model.layers.3.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
|
| 220 |
+
"model.layers.3.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
|
| 221 |
+
"model.layers.3.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
|
| 222 |
+
"model.layers.3.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
|
| 223 |
+
"model.layers.3.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
|
| 224 |
+
"model.layers.30.input_layernorm.weight": "model-00004-of-00005.safetensors",
|
| 225 |
+
"model.layers.30.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
|
| 226 |
+
"model.layers.30.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
|
| 227 |
+
"model.layers.30.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
|
| 228 |
+
"model.layers.30.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
|
| 229 |
+
"model.layers.30.self_attn.k_proj.weight": "model-00004-of-00005.safetensors",
|
| 230 |
+
"model.layers.30.self_attn.o_proj.weight": "model-00004-of-00005.safetensors",
|
| 231 |
+
"model.layers.30.self_attn.q_proj.weight": "model-00004-of-00005.safetensors",
|
| 232 |
+
"model.layers.30.self_attn.v_proj.weight": "model-00004-of-00005.safetensors",
|
| 233 |
+
"model.layers.31.input_layernorm.weight": "model-00004-of-00005.safetensors",
|
| 234 |
+
"model.layers.31.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
|
| 235 |
+
"model.layers.31.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
|
| 236 |
+
"model.layers.31.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
|
| 237 |
+
"model.layers.31.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
|
| 238 |
+
"model.layers.31.self_attn.k_proj.weight": "model-00004-of-00005.safetensors",
|
| 239 |
+
"model.layers.31.self_attn.o_proj.weight": "model-00004-of-00005.safetensors",
|
| 240 |
+
"model.layers.31.self_attn.q_proj.weight": "model-00004-of-00005.safetensors",
|
| 241 |
+
"model.layers.31.self_attn.v_proj.weight": "model-00004-of-00005.safetensors",
|
| 242 |
+
"model.layers.32.input_layernorm.weight": "model-00004-of-00005.safetensors",
|
| 243 |
+
"model.layers.32.mlp.down_proj.weight": "model-00004-of-00005.safetensors",
|
| 244 |
+
"model.layers.32.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
|
| 245 |
+
"model.layers.32.mlp.up_proj.weight": "model-00004-of-00005.safetensors",
|
| 246 |
+
"model.layers.32.post_attention_layernorm.weight": "model-00004-of-00005.safetensors",
|
| 247 |
+
"model.layers.32.self_attn.k_proj.weight": "model-00004-of-00005.safetensors",
|
| 248 |
+
"model.layers.32.self_attn.o_proj.weight": "model-00004-of-00005.safetensors",
|
| 249 |
+
"model.layers.32.self_attn.q_proj.weight": "model-00004-of-00005.safetensors",
|
| 250 |
+
"model.layers.32.self_attn.v_proj.weight": "model-00004-of-00005.safetensors",
|
| 251 |
+
"model.layers.33.input_layernorm.weight": "model-00005-of-00005.safetensors",
|
| 252 |
+
"model.layers.33.mlp.down_proj.weight": "model-00005-of-00005.safetensors",
|
| 253 |
+
"model.layers.33.mlp.gate_proj.weight": "model-00004-of-00005.safetensors",
|
| 254 |
+
"model.layers.33.mlp.up_proj.weight": "model-00005-of-00005.safetensors",
|
| 255 |
+
"model.layers.33.post_attention_layernorm.weight": "model-00005-of-00005.safetensors",
|
| 256 |
+
"model.layers.33.self_attn.k_proj.weight": "model-00004-of-00005.safetensors",
|
| 257 |
+
"model.layers.33.self_attn.o_proj.weight": "model-00004-of-00005.safetensors",
|
| 258 |
+
"model.layers.33.self_attn.q_proj.weight": "model-00004-of-00005.safetensors",
|
| 259 |
+
"model.layers.33.self_attn.v_proj.weight": "model-00004-of-00005.safetensors",
|
| 260 |
+
"model.layers.34.input_layernorm.weight": "model-00005-of-00005.safetensors",
|
| 261 |
+
"model.layers.34.mlp.down_proj.weight": "model-00005-of-00005.safetensors",
|
| 262 |
+
"model.layers.34.mlp.gate_proj.weight": "model-00005-of-00005.safetensors",
|
| 263 |
+
"model.layers.34.mlp.up_proj.weight": "model-00005-of-00005.safetensors",
|
| 264 |
+
"model.layers.34.post_attention_layernorm.weight": "model-00005-of-00005.safetensors",
|
| 265 |
+
"model.layers.34.self_attn.k_proj.weight": "model-00005-of-00005.safetensors",
|
| 266 |
+
"model.layers.34.self_attn.o_proj.weight": "model-00005-of-00005.safetensors",
|
| 267 |
+
"model.layers.34.self_attn.q_proj.weight": "model-00005-of-00005.safetensors",
|
| 268 |
+
"model.layers.34.self_attn.v_proj.weight": "model-00005-of-00005.safetensors",
|
| 269 |
+
"model.layers.35.input_layernorm.weight": "model-00005-of-00005.safetensors",
|
| 270 |
+
"model.layers.35.mlp.down_proj.weight": "model-00005-of-00005.safetensors",
|
| 271 |
+
"model.layers.35.mlp.gate_proj.weight": "model-00005-of-00005.safetensors",
|
| 272 |
+
"model.layers.35.mlp.up_proj.weight": "model-00005-of-00005.safetensors",
|
| 273 |
+
"model.layers.35.post_attention_layernorm.weight": "model-00005-of-00005.safetensors",
|
| 274 |
+
"model.layers.35.self_attn.k_proj.weight": "model-00005-of-00005.safetensors",
|
| 275 |
+
"model.layers.35.self_attn.o_proj.weight": "model-00005-of-00005.safetensors",
|
| 276 |
+
"model.layers.35.self_attn.q_proj.weight": "model-00005-of-00005.safetensors",
|
| 277 |
+
"model.layers.35.self_attn.v_proj.weight": "model-00005-of-00005.safetensors",
|
| 278 |
+
"model.layers.36.input_layernorm.weight": "model-00005-of-00005.safetensors",
|
| 279 |
+
"model.layers.36.mlp.down_proj.weight": "model-00005-of-00005.safetensors",
|
| 280 |
+
"model.layers.36.mlp.gate_proj.weight": "model-00005-of-00005.safetensors",
|
| 281 |
+
"model.layers.36.mlp.up_proj.weight": "model-00005-of-00005.safetensors",
|
| 282 |
+
"model.layers.36.post_attention_layernorm.weight": "model-00005-of-00005.safetensors",
|
| 283 |
+
"model.layers.36.self_attn.k_proj.weight": "model-00005-of-00005.safetensors",
|
| 284 |
+
"model.layers.36.self_attn.o_proj.weight": "model-00005-of-00005.safetensors",
|
| 285 |
+
"model.layers.36.self_attn.q_proj.weight": "model-00005-of-00005.safetensors",
|
| 286 |
+
"model.layers.36.self_attn.v_proj.weight": "model-00005-of-00005.safetensors",
|
| 287 |
+
"model.layers.37.input_layernorm.weight": "model-00005-of-00005.safetensors",
|
| 288 |
+
"model.layers.37.mlp.down_proj.weight": "model-00005-of-00005.safetensors",
|
| 289 |
+
"model.layers.37.mlp.gate_proj.weight": "model-00005-of-00005.safetensors",
|
| 290 |
+
"model.layers.37.mlp.up_proj.weight": "model-00005-of-00005.safetensors",
|
| 291 |
+
"model.layers.37.post_attention_layernorm.weight": "model-00005-of-00005.safetensors",
|
| 292 |
+
"model.layers.37.self_attn.k_proj.weight": "model-00005-of-00005.safetensors",
|
| 293 |
+
"model.layers.37.self_attn.o_proj.weight": "model-00005-of-00005.safetensors",
|
| 294 |
+
"model.layers.37.self_attn.q_proj.weight": "model-00005-of-00005.safetensors",
|
| 295 |
+
"model.layers.37.self_attn.v_proj.weight": "model-00005-of-00005.safetensors",
|
| 296 |
+
"model.layers.38.input_layernorm.weight": "model-00005-of-00005.safetensors",
|
| 297 |
+
"model.layers.38.mlp.down_proj.weight": "model-00005-of-00005.safetensors",
|
| 298 |
+
"model.layers.38.mlp.gate_proj.weight": "model-00005-of-00005.safetensors",
|
| 299 |
+
"model.layers.38.mlp.up_proj.weight": "model-00005-of-00005.safetensors",
|
| 300 |
+
"model.layers.38.post_attention_layernorm.weight": "model-00005-of-00005.safetensors",
|
| 301 |
+
"model.layers.38.self_attn.k_proj.weight": "model-00005-of-00005.safetensors",
|
| 302 |
+
"model.layers.38.self_attn.o_proj.weight": "model-00005-of-00005.safetensors",
|
| 303 |
+
"model.layers.38.self_attn.q_proj.weight": "model-00005-of-00005.safetensors",
|
| 304 |
+
"model.layers.38.self_attn.v_proj.weight": "model-00005-of-00005.safetensors",
|
| 305 |
+
"model.layers.39.input_layernorm.weight": "model-00005-of-00005.safetensors",
|
| 306 |
+
"model.layers.39.mlp.down_proj.weight": "model-00005-of-00005.safetensors",
|
| 307 |
+
"model.layers.39.mlp.gate_proj.weight": "model-00005-of-00005.safetensors",
|
| 308 |
+
"model.layers.39.mlp.up_proj.weight": "model-00005-of-00005.safetensors",
|
| 309 |
+
"model.layers.39.post_attention_layernorm.weight": "model-00005-of-00005.safetensors",
|
| 310 |
+
"model.layers.39.self_attn.k_proj.weight": "model-00005-of-00005.safetensors",
|
| 311 |
+
"model.layers.39.self_attn.o_proj.weight": "model-00005-of-00005.safetensors",
|
| 312 |
+
"model.layers.39.self_attn.q_proj.weight": "model-00005-of-00005.safetensors",
|
| 313 |
+
"model.layers.39.self_attn.v_proj.weight": "model-00005-of-00005.safetensors",
|
| 314 |
+
"model.layers.4.input_layernorm.weight": "model-00001-of-00005.safetensors",
|
| 315 |
+
"model.layers.4.mlp.down_proj.weight": "model-00001-of-00005.safetensors",
|
| 316 |
+
"model.layers.4.mlp.gate_proj.weight": "model-00001-of-00005.safetensors",
|
| 317 |
+
"model.layers.4.mlp.up_proj.weight": "model-00001-of-00005.safetensors",
|
| 318 |
+
"model.layers.4.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
|
| 319 |
+
"model.layers.4.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
|
| 320 |
+
"model.layers.4.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
|
| 321 |
+
"model.layers.4.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
|
| 322 |
+
"model.layers.4.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
|
| 323 |
+
"model.layers.5.input_layernorm.weight": "model-00001-of-00005.safetensors",
|
| 324 |
+
"model.layers.5.mlp.down_proj.weight": "model-00001-of-00005.safetensors",
|
| 325 |
+
"model.layers.5.mlp.gate_proj.weight": "model-00001-of-00005.safetensors",
|
| 326 |
+
"model.layers.5.mlp.up_proj.weight": "model-00001-of-00005.safetensors",
|
| 327 |
+
"model.layers.5.post_attention_layernorm.weight": "model-00001-of-00005.safetensors",
|
| 328 |
+
"model.layers.5.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
|
| 329 |
+
"model.layers.5.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
|
| 330 |
+
"model.layers.5.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
|
| 331 |
+
"model.layers.5.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
|
| 332 |
+
"model.layers.6.input_layernorm.weight": "model-00002-of-00005.safetensors",
|
| 333 |
+
"model.layers.6.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
|
| 334 |
+
"model.layers.6.mlp.gate_proj.weight": "model-00001-of-00005.safetensors",
|
| 335 |
+
"model.layers.6.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
|
| 336 |
+
"model.layers.6.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
|
| 337 |
+
"model.layers.6.self_attn.k_proj.weight": "model-00001-of-00005.safetensors",
|
| 338 |
+
"model.layers.6.self_attn.o_proj.weight": "model-00001-of-00005.safetensors",
|
| 339 |
+
"model.layers.6.self_attn.q_proj.weight": "model-00001-of-00005.safetensors",
|
| 340 |
+
"model.layers.6.self_attn.v_proj.weight": "model-00001-of-00005.safetensors",
|
| 341 |
+
"model.layers.7.input_layernorm.weight": "model-00002-of-00005.safetensors",
|
| 342 |
+
"model.layers.7.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
|
| 343 |
+
"model.layers.7.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
|
| 344 |
+
"model.layers.7.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
|
| 345 |
+
"model.layers.7.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
|
| 346 |
+
"model.layers.7.self_attn.k_proj.weight": "model-00002-of-00005.safetensors",
|
| 347 |
+
"model.layers.7.self_attn.o_proj.weight": "model-00002-of-00005.safetensors",
|
| 348 |
+
"model.layers.7.self_attn.q_proj.weight": "model-00002-of-00005.safetensors",
|
| 349 |
+
"model.layers.7.self_attn.v_proj.weight": "model-00002-of-00005.safetensors",
|
| 350 |
+
"model.layers.8.input_layernorm.weight": "model-00002-of-00005.safetensors",
|
| 351 |
+
"model.layers.8.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
|
| 352 |
+
"model.layers.8.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
|
| 353 |
+
"model.layers.8.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
|
| 354 |
+
"model.layers.8.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
|
| 355 |
+
"model.layers.8.self_attn.k_proj.weight": "model-00002-of-00005.safetensors",
|
| 356 |
+
"model.layers.8.self_attn.o_proj.weight": "model-00002-of-00005.safetensors",
|
| 357 |
+
"model.layers.8.self_attn.q_proj.weight": "model-00002-of-00005.safetensors",
|
| 358 |
+
"model.layers.8.self_attn.v_proj.weight": "model-00002-of-00005.safetensors",
|
| 359 |
+
"model.layers.9.input_layernorm.weight": "model-00002-of-00005.safetensors",
|
| 360 |
+
"model.layers.9.mlp.down_proj.weight": "model-00002-of-00005.safetensors",
|
| 361 |
+
"model.layers.9.mlp.gate_proj.weight": "model-00002-of-00005.safetensors",
|
| 362 |
+
"model.layers.9.mlp.up_proj.weight": "model-00002-of-00005.safetensors",
|
| 363 |
+
"model.layers.9.post_attention_layernorm.weight": "model-00002-of-00005.safetensors",
|
| 364 |
+
"model.layers.9.self_attn.k_proj.weight": "model-00002-of-00005.safetensors",
|
| 365 |
+
"model.layers.9.self_attn.o_proj.weight": "model-00002-of-00005.safetensors",
|
| 366 |
+
"model.layers.9.self_attn.q_proj.weight": "model-00002-of-00005.safetensors",
|
| 367 |
+
"model.layers.9.self_attn.v_proj.weight": "model-00002-of-00005.safetensors",
|
| 368 |
+
"model.norm.weight": "model-00005-of-00005.safetensors"
|
| 369 |
+
}
|
| 370 |
+
}
|
Mistral-NeMo-12B-Instruct-HF/run.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from mistral_common.tokens.tokenizers.mistral import MistralTokenizer
|
| 2 |
+
from mistral_common.protocol.instruct.messages import UserMessage
|
| 3 |
+
from mistral_common.protocol.instruct.request import ChatCompletionRequest
|
| 4 |
+
from transformers import AutoModelForCausalLM
|
| 5 |
+
import torch
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
# Load Mistral tokenizer
|
| 9 |
+
model_name = "nemostral"
|
| 10 |
+
tokenizer = MistralTokenizer.from_model(model_name)
|
| 11 |
+
|
| 12 |
+
# Tokenize a list of messages
|
| 13 |
+
tokenized = tokenizer.encode_chat_completion(
|
| 14 |
+
ChatCompletionRequest(
|
| 15 |
+
messages=[
|
| 16 |
+
UserMessage(content="How many peolpe live in France and all its neighbours? List all of them!")
|
| 17 |
+
],
|
| 18 |
+
model=model_name,
|
| 19 |
+
)
|
| 20 |
+
)
|
| 21 |
+
tokens, text = tokenized.tokens, tokenized.text
|
| 22 |
+
|
| 23 |
+
input_ids = torch.tensor([tokens]).to("cuda")
|
| 24 |
+
|
| 25 |
+
model = AutoModelForCausalLM.from_pretrained("./", torch_dtype=torch.bfloat16).to("cuda")
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
out = model.generate(input_ids, max_new_tokens=1024)
|
| 29 |
+
|
| 30 |
+
generated = out[0, input_ids.shape[-1]:-1].tolist()
|
| 31 |
+
|
| 32 |
+
print(tokenizer.decode(generated))
|