return false;
}
- std::string word;
+ std::vector<char> word(32);
vocab.id_to_token.resize(n_vocab);
for (int i = 0; i < n_vocab; i++) {
uint32_t len;
finp.read ((char *) &score, sizeof(score));
fout.write((char *) &score, sizeof(score));
- vocab.token_to_id[word] = i;
+ vocab.token_to_id[word.data()] = i;
auto &tok_score = vocab.id_to_token[i];
- tok_score.tok = word;
+ tok_score.tok = word.data();
tok_score.score = score;
}
}