wip ollama emulation, added detokenize endpoint

This commit is contained in:
Concedo 2024-11-23 22:48:03 +08:00
parent c0da7e4dcf
commit 2c1a06a07d
4 changed files with 62 additions and 7 deletions

View file

@ -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)