mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-19 01:05:09 +02:00
added skip bos for tokenize endpoint
This commit is contained in:
+2
-1
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user