common : remove duplicate function llama_should_add_bos_token (#8778)

This commit is contained in:
Zhenwei Jin 2024-08-15 15:23:23 +08:00 committed by GitHub
parent 6bda7ce6c3
commit 4af8420afb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 26 additions and 40 deletions

View file

@ -2702,12 +2702,6 @@ std::string llama_detokenize(llama_context * ctx, const std::vector<llama_token>
return text;
}
bool llama_should_add_bos_token(const llama_model * model) {
const int add_bos = llama_add_bos_token(model);
return add_bos != -1 ? bool(add_bos) : (llama_vocab_type(model) == LLAMA_VOCAB_TYPE_SPM);
}
//
// Chat template utils
//

View file

@ -380,10 +380,6 @@ std::string llama_detokenize(
const std::vector<llama_token> & tokens,
bool special = true);
// Uses the value from the model metadata if possible, otherwise
// defaults to true when model type is SPM, otherwise false.
bool llama_should_add_bos_token(const llama_model * model);
//
// Chat template utils
//