mlc-ai / mlc-llm

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

How to set model_lib in app.config.json Android? #1935

Closed LumenScopeAI closed 5 months ago

LumenScopeAI commented 7 months ago

❓ General Questions

I use these json, but meet some problems. So how to set model_lib? The problems I meet is the same as: https://github.com/mlc-ai/mlc-llm/issues/1517

{
  "model_list": [
    {
      "model_url": "https://huggingface.co/mlc-ai/Llama-2-7b-chat-hf-q4f16_1-MLC/",
      "model_lib": "llama_q4f16_1",
      "estimated_vram_bytes": 4348727787,
      "model_id": "Yi-6B-Chat-q4f16_1"
    },
    {
      "model_url": "https://huggingface.co/mlc-ai/Llama-2-7b-chat-hf-q4f16_1-MLC/",
      "model_lib": "llama_q40f16",
      "estimated_vram_bytes": 4348727787,
      "model_id": "Qwen1.5-1.8B-Chat-q0f16"
    }
  ],
  "model_lib_path_for_prepare_libs": {
    "Yi-6B-Chat-q4f16_1": "Yi-6B-Chat-q4f16_1-MLC/Yi-6B-Chat-q4f16_1-android.tar",
    "Qwen1.5-1.8B-Chat-q0f16": "Qwen1.5-1.8B-Chat-q0f16-MLC/Qwen1.5-1.8B-Chat-q0f16-android.tar"
  }
}
Kartik14 commented 7 months ago

Hi the model_lib has the format mode_type_quantization. you can find both these fields inside the mlc-chat-config.json file inside the model directory. Also you need to have a matching JSON inside model_list for each model lib key inside model_lib_path_for_prepare_libs. Please refer to the base app-config.json file for reference. You can also checkout the docs here

MrRace commented 7 months ago

@LumenScopeAI what value should I set for the parameter --conv-template when use Yi-6B-Chat ?