Skip to content

Commit d3f202d

Browse files
authored
Remove unused code since n_vocab is model.hparams.n_vocab (#262)
1 parent e03e359 commit d3f202d

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

main.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,8 @@ bool llama_model_load(const std::string & fname, llama_model & model, gpt_vocab
143143

144144
// load vocab
145145
{
146-
const int32_t n_vocab = model.hparams.n_vocab;
147-
148-
if (n_vocab != model.hparams.n_vocab) {
149-
fprintf(stderr, "%s: invalid model file '%s' (bad vocab size %d != %d)\n",
150-
__func__, fname.c_str(), n_vocab, model.hparams.n_vocab);
151-
return false;
152-
}
153-
154146
std::string word;
155-
for (int i = 0; i < n_vocab; i++) {
147+
for (int i = 0; i < model.hparams.n_vocab; i++) {
156148
uint32_t len;
157149
fin.read((char *) &len, sizeof(len));
158150

0 commit comments

Comments
 (0)