Skip to content

[BUG]: Second Response Empty when using Grammar #906

@L-Wehmschulte

Description

@L-Wehmschulte

Description

I've created a Model following this Example:
GrammarJsonResponse.cs

I'm using the provided grammar, which forces the model to respond in JSON

This works great for the first prompt, but for any subsequent prompt, the response is just Empty

Reproduction Steps

=> See: second Prompt is Empty

Environment & Configuration

  • Operating system: Windows 11
  • .NET runtime version: .NET 8
  • LLamaSharp version: 0.15.0
  • CUDA version (if you are using cuda backend): 12
  • CPU & GPU device: 13th Gen Intel(R) Core(TM) i7-13850HX, 2100 Mhz, 20 Core(s), 28 Logical Processor(s) & Nvidia RTX 4000 Ada Generation Laptop GPU

Known Workarounds

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions