Skip to content

Commit

Permalink
Remove unused code since n_vocab is model.hparams.n_vocab (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiendung authored Mar 18, 2023
1 parent e03e359 commit d3f202d
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,8 @@ bool llama_model_load(const std::string & fname, llama_model & model, gpt_vocab

// load vocab
{
const int32_t n_vocab = model.hparams.n_vocab;

if (n_vocab != model.hparams.n_vocab) {
fprintf(stderr, "%s: invalid model file '%s' (bad vocab size %d != %d)\n",
__func__, fname.c_str(), n_vocab, model.hparams.n_vocab);
return false;
}

std::string word;
for (int i = 0; i < n_vocab; i++) {
for (int i = 0; i < model.hparams.n_vocab; i++) {
uint32_t len;
fin.read((char *) &len, sizeof(len));

Expand Down

0 comments on commit d3f202d

Please sign in to comment.