mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-11 01:24:36 +00:00
wip ollama emulation, added detokenize endpoint
This commit is contained in:
parent
c0da7e4dcf
commit
2c1a06a07d
4 changed files with 62 additions and 7 deletions
12
expose.cpp
12
expose.cpp
|
@ -300,6 +300,18 @@ extern "C"
|
|||
return output;
|
||||
}
|
||||
|
||||
static std::string detokenized_str = ""; //just share a static object for detokenizing
|
||||
const char * detokenize(const token_count_outputs input)
|
||||
{
|
||||
std::vector<int> input_arr;
|
||||
for(int i=0;i<input.count;++i)
|
||||
{
|
||||
input_arr.push_back(input.ids[i]);
|
||||
}
|
||||
detokenized_str = gpttype_detokenize(input_arr,false);
|
||||
return detokenized_str.c_str();
|
||||
}
|
||||
|
||||
static std::vector<TopPicksData> last_logprob_toppicks;
|
||||
static std::vector<logprob_item> last_logprob_items;
|
||||
last_logprobs_outputs last_logprobs()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue