GithubHelp home page GithubHelp logo

Comments (4)

tqchen avatar tqchen commented on June 1, 2024

thanks @dtkettler can you also let us know what is the model and prompt? having an example script would be helpful

from mlc-llm.

dtkettler avatar dtkettler commented on June 1, 2024

Sure. I have run into this with every prompt I have tried, but here's a very simple example adapted from the basic usage in the MLC-LLM documentation:

from mlc_llm import LLMEngine

# Create engine
model = "HF://mlc-ai/Llama-3-8B-Instruct-q4f16_1-MLC"
engine = LLMEngine(model)

# Run chat completion in OpenAI API.
response = engine.chat.completions.create(
    messages=[{"role": "user", "content": """
Produce a JSON object with a list of US states and the largest cities in those states
The list should have the following keys:
'state' - Name of the state
'cities' - Another list containing city names"""}],
    model=model,
    response_format={"type": "json_object"},
    stream=False
)

print(response)

engine.terminate()

from mlc-llm.

Ubospica avatar Ubospica commented on June 1, 2024

Thanks for the report @dtkettler Currently there are several issues with llama3 because it changes the tokenizer a lot. That will be fixed soon in these days

from mlc-llm.

FreakTheMighty avatar FreakTheMighty commented on June 1, 2024

I'm seeing a similar error when using phi-2-q4f16_1-MLC

InternalError: Check failed: (accepted) is false: Token id 0 is not accepted by the grammar state matcher

from mlc-llm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.