mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-13 02:19:41 +00:00
added skip bos for tokenize endpoint
This commit is contained in:
parent
5789417802
commit
10b148f4c2
5 changed files with 11 additions and 12 deletions
|
@ -277,11 +277,11 @@ extern "C"
|
|||
}
|
||||
|
||||
static std::vector<int> toks; //just share a static object for token counting
|
||||
token_count_outputs token_count(const char * input)
|
||||
token_count_outputs token_count(const char * input, bool addbos)
|
||||
{
|
||||
std::string inputstr = input;
|
||||
token_count_outputs output;
|
||||
toks = gpttype_get_token_arr(inputstr);
|
||||
toks = gpttype_get_token_arr(inputstr,addbos);
|
||||
output.count = toks.size();
|
||||
output.ids = toks.data(); //this may be slightly unsafe
|
||||
return output;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue