mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 17:14:36 +00:00
add in backwards compatibility for older clients with incorrect json_schema passing
This commit is contained in:
parent
aa3623dcce
commit
0e8f96414a
1 changed files with 9 additions and 0 deletions
|
@ -2333,6 +2333,15 @@ ws ::= | " " | "\n" [ \t]{0,20}
|
|||
# In case of any issues, just do normal gen
|
||||
print("Structured Output not valid - discarded")
|
||||
pass
|
||||
elif 'json_schema' in genparams:
|
||||
try:
|
||||
schema = genparams.get('json_schema')
|
||||
decoded = convert_json_to_gbnf(schema)
|
||||
if decoded:
|
||||
genparams["grammar"] = decoded
|
||||
except Exception:
|
||||
print("Structured Output (old format) not valid - discarded")
|
||||
pass
|
||||
|
||||
message_index = 0
|
||||
for message in messages_array:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue