Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

The latest version kills python kernel with LlamaGrammar #1623

Copy link
Copy link
Closed
@yamikumo-DSD

Description

@yamikumo-DSD
Issue body actions

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the latest code. Development is very rapid so there are no tagged versions as of now.
  • I carefully followed the README.md.
  • I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
  • I reviewed the Discussions, and have a new bug or useful enhancement to share.

Expected Behavior and Current Behavior

The latest version of llama-cpp-python kills python kernel with LlamaGrammar.
I ran the following code:

from llama_cpp import Llama, LlamaGrammar
model = Llama(model_path="ggufs/Meta-Llama-3-8B-Instruct.Q5_K_M.gguf", verbose=False) # Model doesn't matter.
grammar = LlamaGrammar.from_string('root ::= "a"+')
model("hello", max_tokens=10, grammar=grammar)

When it ran, the python kernel died immediately for unknown reason. Dying kernel doesn't happen without use of LlamaGrammar.
Because this behavior has not been observed recently (actually few days ago), I suspect my recent update of llama-cpp-python module made this problem.

What I tried is:

  1. Build the latest code by myself -> kernel died
  2. Build the code in the latest release by myself -> kernel died
  3. Re-install wheel of the latest release -> No problem

My experiment might suggest this problem comes from backend Llama.cpp and is not llama-cpp-python's fault.
But anyway, I wanna know whether people is experiencing this bug.

Environment

OS: macOS Sonoma
Processor: M2Max 64GB.
Python version: 11

ExtReMLapin

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.