mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 00:54:41 +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
|
@ -2528,6 +2528,17 @@ std::vector<int> gpttype_get_token_arr(const std::string & input, bool addbos)
|
|||
return toks;
|
||||
}
|
||||
|
||||
std::string gpttype_detokenize(const std::vector<int> & inputids, bool render_special)
|
||||
{
|
||||
std::string output = "";
|
||||
for (auto eid : inputids)
|
||||
{
|
||||
std::string tokenizedstr = FileFormatTokenizeID(eid, file_format, render_special);
|
||||
output += tokenizedstr;
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
const std::string & gpttype_get_pending_output()
|
||||
{
|
||||
if(kcpp_data==nullptr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue