@@ -1279,7 +1279,6 @@ struct llama_vocab::impl {
12791279
12801280 std::string type_name () const ;
12811281
1282- bool is_valid (llama_token id) const ;
12831282 bool is_normal (llama_token id) const ;
12841283 bool is_unknown (llama_token id) const ;
12851284 bool is_control (llama_token id) const ;
@@ -2069,11 +2068,6 @@ std::string llama_vocab::impl::type_name() const{
20692068 }
20702069}
20712070
2072- bool llama_vocab::impl::is_valid (llama_token id) const {
2073- GGML_ASSERT (type != LLAMA_VOCAB_TYPE_NONE);
2074- return 0 <= id && id < (int32_t ) id_to_token.size ();
2075- }
2076-
20772071bool llama_vocab::impl::is_normal (llama_token id) const {
20782072 GGML_ASSERT (type != LLAMA_VOCAB_TYPE_NONE);
20792073 return id_to_token[id].attr & LLAMA_TOKEN_ATTR_NORMAL;
@@ -2766,10 +2760,6 @@ std::string llama_vocab::type_name() const{
27662760 return pimpl->type_name ();
27672761}
27682762
2769- bool llama_vocab::is_valid (llama_token id) const {
2770- return pimpl->is_valid (id);
2771- }
2772-
27732763bool llama_vocab::is_normal (llama_token id) const {
27742764 return pimpl->is_normal (id);
27752765}
@@ -3271,12 +3261,3 @@ int32_t llama_detokenize(
32713261 bool unparse_special) {
32723262 return vocab->detokenize (tokens, n_tokens, text, text_len_max, remove_special, unparse_special);
32733263}
3274-
3275- bool can_detokenize (const struct llama_vocab * vocab, const llama_token * tokens, int32_t n_tokens) {
3276- for (int32_t i = 0 ; i < n_tokens; ++i) {
3277- if (!vocab->is_valid (tokens[i])) {
3278- return false ;
3279- }
3280- }
3281- return true ;
3282- }
0 commit comments