gptj: remove unused variables

This commit is contained in:
Cebtenzzre 2023-10-02 10:04:38 -04:00 committed by Adam Treat
parent f9deb87d20
commit 3c2aa299d8

View File

@ -237,12 +237,7 @@ bool gptj_model_load(const std::string &fname, gptj_model & model, gpt_vocab & v
// prepare memory for the weights // prepare memory for the weights
{ {
const auto & hparams = model.hparams; const auto & hparams = model.hparams;
model.layers.resize(hparams.n_layer);
const int n_embd = hparams.n_embd;
const int n_layer = hparams.n_layer;
const int n_vocab = hparams.n_vocab;
model.layers.resize(n_layer);
model.wte = ggml_get_tensor(ctx, "token_embd.weight"); model.wte = ggml_get_tensor(ctx, "token_embd.weight");
@ -258,7 +253,7 @@ bool gptj_model_load(const std::string &fname, gptj_model & model, gpt_vocab & v
return key.c_str(); return key.c_str();
}; };
for (int i = 0; i < n_layer; ++i) { for (int i = 0; i < hparams.n_layer; ++i) {
auto & layer = model.layers[i]; auto & layer = model.layers[i];
layer.ln_1_g = ggml_get_tensor(ctx, name(i, "attn_norm.weight")); layer.ln_1_g = ggml_get_tensor(ctx, name(i, "attn_norm.weight"));