mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 09:04:36 +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
|
@ -1352,7 +1352,8 @@ Enter Prompt:<br>
|
|||
try:
|
||||
genparams = json.loads(body)
|
||||
countprompt = genparams.get('prompt', "")
|
||||
rawcountdata = handle.token_count(countprompt.encode("UTF-8"))
|
||||
tcaddspecial = genparams.get('special', True)
|
||||
rawcountdata = handle.token_count(countprompt.encode("UTF-8"),tcaddspecial)
|
||||
countlimit = rawcountdata.count if (rawcountdata.count>=0 and rawcountdata.count<50000) else 0
|
||||
# the above protects the server in case the count limit got corrupted
|
||||
countdata = [rawcountdata.ids[i] for i in range(countlimit)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue