mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-11 09:34:37 +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
|
# In case of any issues, just do normal gen
|
||||||
print("Structured Output not valid - discarded")
|
print("Structured Output not valid - discarded")
|
||||||
pass
|
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
|
message_index = 0
|
||||||
for message in messages_array:
|
for message in messages_array:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue