Open HoiM opened 4 days ago
HI @HoiM, could you try to install the latest nightly packages of mlc-llm and mlc-ai? We fixed the issue last week in https://github.com/mlc-ai/mlc-llm/commit/347407375474e99dcb14647299853c7e1263c008, which is not yet included in a stable release. You can find the nightly package installation instructions at https://llm.mlc.ai/docs/install/mlc_llm.html.
On my MacOS, reinstalling the following two wheels solved the problem.
pip install mlc_ai_nightly_cpu-0.18.dev249-cp39-cp39-macosx_13_0_arm64.whl
pip install mlc_llm_nightly_cpu-0.18.dev71-cp39-cp39-macosx_13_0_arm64.whl
THX!
🐛 Bug
I am trying to run llava with mlc-llm. On both a linux server machine and a local MacOS, I encountered this error:
(run
export RUST_BACKTRACE=full
before running the inference program.)To Reproduce
Steps to reproduce the behavior:
On MacOS:
On Linux:
model = "/path/to/llava-1.5-7b-hf-mlc" model_lib = "/path/to/llava-1.5-7b-hf-mlc/llava-1.5-7b-q4f16_1-cuda.so" image_path = "/path/to/image.jpg" engine = MLCEngine(model=model, model_lib=model_lib)
img = PIL.Image.open(image_path) img_resized = img.resize((336, 336))
img_byte_arr = BytesIO() img_resized.save(img_byte_arr, format="JPEG") img_byte_arr = img_byte_arr.getvalue()
new_url = ( f"data:image/jpeg;base64,{base64.b64encode(img_byte_arr).decode('utf-8')}" )
for response in engine.chat.completions.create( messages=[{ "role": "user", "content": [ { "type": "image_url", "image_url": new_url, }, { "type": "text", "text": "What is shown in this image?",
},
],
}],
model=model,
stream=True,
):
for choice in response.choices:
print(choice.delta.content, end="", flush=True)
engine.terminate()