From d3f202d57b694376cef6f381a6b6901825c3f6d9 Mon Sep 17 00:00:00 2001 From: Alex Nguyen Date: Sat, 18 Mar 2023 20:51:49 +0700 Subject: [PATCH] Remove unused code since n_vocab is model.hparams.n_vocab (#262) --- main.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/main.cpp b/main.cpp index eb78fe5ab..c88405b82 100644 --- a/main.cpp +++ b/main.cpp @@ -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));