Open ksrinivs64 opened 3 days ago
On more examination, it does seem to produce
A: {
"name": "India",
"capital": "New Delhi",
"population": "1.366 billion"
}
A JSON object can be an array, so the model's generation is syntactically correct. This can happen in some cases, can you try switching to more recent models https://huggingface.co/Qwen/Qwen2.5-3B or https://huggingface.co/meta-llama/Llama-3.2-3B?
I tried with a custom grammar and a larger model, same situation.
Can you share the code you are running with the custom grammar? I'll take a look at what's going wrong
Produces:
Worse yet, it sometimes produces ungrammatical sequences because it produces tokens till the maximum number of tokens and stops. For instance with max tokens set to 51, it produces:
Even if I include end of sequence tokens in a custom grammar, constrained decoding produces tokens without ever producing an token.
Is there a fix to this behavior?