mlc-ai / mlc-llm

Universal LLM Deployment Engine with ML Compilation
https://llm.mlc.ai/
Apache License 2.0
17.74k stars 1.41k forks source link

[Bug] Does MLC LLM support function call ? #2570

Open Stephen888888 opened 3 weeks ago

Stephen888888 commented 3 weeks ago

🐛 Bug

To Reproduce

Steps to reproduce the behavior:

  1. mlc_llm convert_weight ./dist/models/Qwen2-1.5B-Instruct/ --model-type qwen2 --quantization q0f16 -o dist/Qwen2-1.5B-Instruct-q0f16-MLC
  2. mlc_llm gen_config ./dist/models/Qwen2-1.5B-Instruct/ --model-type qwen2 --quantization q0f16 --conv-template chatml --context-window-size 2048 --max-batch-size 1 -o dist/Qwen2-1.5B-Instruct-q0f16-MLC/
  3. mlc_llm package

Expected behavior

Environment

Additional context

panghongtao commented 2 weeks ago

Your actions should have generated the mlc model file. You can run it on Android or ios. I thought I'd give your idea a try

Stephen888888 commented 2 weeks ago

@panghongtao yes,already run on android phone. but i need function call

panghongtao commented 2 weeks ago

You can try using their Android demo app for a while. Make sure that the model you need can be used before developing it. Android is open source. If you want to include this feature in your own APP. Maybe you need to develop. You want a demo interface, right?

Stephen888888 commented 2 weeks ago

@panghongtao yes,can you give me a demo interface ?

panghongtao commented 2 weeks ago

you can dowland this https://objects.githubusercontent.com/github-production-release-asset-2e65be/633675943/81fe934a-807d-4f70-8d36-84b5e6fc4445?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20240620%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240620T025018Z&X-Amz-Expires=300&X-Amz-Signature=b65b2a4fc2e1e8ce4820d5f1a2484947ae46b96279ac283abac2182f3dab17ea&X-Amz-SignedHeaders=host&actor_id=152578991&key_id=0&repo_id=633675943&response-content-disposition=attachment%3B%20filename%3Dmlc-chat.apk&response-content-type=application%2Fvnd.android.package-archive

and this android API you can look it

https://llm.mlc.ai/docs/deploy/android.html

if you want change model. you can look mlc app's files folder. this folder is mlc model.