Merge branch 'upstream' into concedo_experimental

# Conflicts:
#	common/sampling.h
#	llama.h
#	tests/test-chat-template.cpp
This commit is contained in:
Concedo 2024-04-24 21:29:07 +08:00
commit a681cdd9ef
20 changed files with 788 additions and 355 deletions

View file

@ -253,11 +253,12 @@ std::vector<llama_token> llama_tokenize(
bool add_special,
bool parse_special = false);
// tokenizes a token into a piece
// tokenizes a token into a piece, optionally renders special/control tokens
// should work similar to Python's `tokenizer.id_to_piece`
std::string llama_token_to_piece(
const struct llama_context * ctx,
llama_token token);
llama_token token,
bool special = true);
// TODO: these should be moved in llama.h C-style API under single `llama_detokenize` function
// that takes into account the tokenizer type and decides how to handle the leading space