xgrammar icon indicating copy to clipboard operation
xgrammar copied to clipboard

Support for max length of array to be generated

Open arunpatala opened this issue 11 months ago • 1 comments

Hi,

Thanks for this awesome work.

I was wondering if generating a maximum number of elements in an array is possible with xgrammar. If so, how can I use it. Any help would be much appreciated.

Thanks

arunpatala avatar Jan 20 '25 11:01 arunpatala

Hi @arunpatala, thanks for the question! The repetition range {min, max} is now supported by regex and ebnf, so you can use them to constraint the generation format. Regarding json schema, we are still enhancing it. We expect it be completed recently.

Ubospica avatar Jan 26 '25 04:01 Ubospica