Skip to content
This repository was archived by the owner on Apr 18, 2023. It is now read-only.

Commit 8b9e537

Browse files
tiendungmudler
authored andcommitted
Remove unused code since n_vocab is model.hparams.n_vocab (ggml-org#262)
1 parent 8865f10 commit 8b9e537

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

lama.cpp

+1-9
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,8 @@ bool llama_model_load(const std::string & fname, llama_model & model, gpt_vocab
153153

154154
// load vocab
155155
{
156-
const int32_t n_vocab = model.hparams.n_vocab;
157-
158-
if (n_vocab != model.hparams.n_vocab) {
159-
fprintf(stderr, "%s: invalid model file '%s' (bad vocab size %d != %d)\n",
160-
__func__, fname.c_str(), n_vocab, model.hparams.n_vocab);
161-
return false;
162-
}
163-
164156
std::string word;
165-
for (int i = 0; i < n_vocab; i++) {
157+
for (int i = 0; i < model.hparams.n_vocab; i++) {
166158
uint32_t len;
167159
fin.read((char *) &len, sizeof(len));
168160

0 commit comments

Comments
 (0)