aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Nguyen <tiendung@users.noreply.github.com>2023-03-18 20:51:49 +0700
committerGitHub <noreply@github.com>2023-03-18 13:51:49 +0000
commitd3f202d57b694376cef6f381a6b6901825c3f6d9 (patch)
tree03e802d51a71e8dccd48095a9c62162f1697f26a
parente03e359730c127f888fcf00e93375771bc0a3500 (diff)
Remove unused code since n_vocab is model.hparams.n_vocab (#262)
-rw-r--r--main.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/main.cpp b/main.cpp
index eb78fe5..c88405b 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));