mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-04-29 02:31:48 +00:00
Allow either "[" or "{" prefix to support JSON grammar with top level arrays (#129)
This commit is contained in:
@@ -79,8 +79,11 @@ class ExLlamaV2Grammar:
|
||||
|
||||
return
|
||||
|
||||
# Allow JSON objects or JSON arrays at the top level
|
||||
json_prefixes = ["[", "{"]
|
||||
|
||||
lmfilter = ExLlamaV2TokenEnforcerFilter(schema_parser, tokenizer)
|
||||
prefix_filter = ExLlamaV2PrefixFilter(model, tokenizer, "{")
|
||||
prefix_filter = ExLlamaV2PrefixFilter(model, tokenizer, json_prefixes)
|
||||
|
||||
# Append the filters
|
||||
self.filters.extend([lmfilter, prefix_filter])
|
||||
|
||||
Reference in New Issue
Block a user