Comments (7)
thanks @dtkettler can you also let us know what is the model and prompt? having an example script would be helpful
from mlc-llm.
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.
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.
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.
llama3 should be fixed by latest version
from mlc-llm.
Hi,
I tried it out and yes Llama 3 runs without error now. However I still run into a pretty serious issue with it. If I specify a schema in the response_format it just...returns the schema back to me. Like, the output is literally just the schema I gave it, not an actual response. If I just change the model to something else with no changes to my code I do not encounter this behavior so it's something specific to Llama 3.
from mlc-llm.
Thanks @dtkettler , there are some fixes that just come in now, so please wait another day for the effect to kick into nightly.
when runnning json mode, likely you want to prompt your model and ask for it to output json
from mlc-llm.
Related Issues (20)
- [Bug] phi 2 q4 model doesn't work
- Phi-2 q4f16_1 runs faster when compiled without `tvm.relax.transform.FuseOps()` and `tvm.relax.transform.FuseTIR()` transformations HOT 4
- [Question] KVCache: 0.00 MB when compiling models HOT 3
- [Bug] mlc_llm chat not working: ValueError: Cannot find global var "multinomial_from_uniform1" in the Module HOT 7
- [Feature Request] phi-3 small realeased -> performs two times ebtter then Phi-3 mini
- [Bug]: Error on "The block is 1-time referenced by other blocks, thus cannot accept new KV values." HOT 2
- [Doc] Python API KV/memory reset details absent HOT 6
- [Question] Why `Chat`and `Completion` have different structure in `engine.py`? HOT 2
- Unable to serve Mistral-7B-Instruct-v0.3 HOT 3
- qwen1.5-0.5B-chat : lm_head.weight HOT 6
- [Question] How to independently clone the 3rdparty/tvm of mlc_llm, the commit id in submodule can't be found in either mlc-ai/relax or apache/tvm HOT 3
- 'ChatGLMTokenizer' object has no attribute 'backend_tokenizer' HOT 1
- [Question] Does OpenCL on Adreno GPU support OpenCL ML SDK HOT 1
- mlc_llm serve fails on concurrent users - Llama3 70B parameter hosting HOT 3
- 执行mlc_chat指令时总是报错 HOT 3
- Compiling WebAssembly library with debug symbols/source map to aid in debugging
- [Doc] Request for suggested build-from-source options + explanation of added functionality
- [Doc] benchmark on different hardware
- [Bug] iOS | mlc_llm package not working HOT 6
- [Model Request] T5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mlc-llm.