I wasnât able to get meta-llama/Llama-2-7b-hf to run correctly with the supplied python client so I am using the chat variant (Llama-2-7b-chat-hf) as a proxy. I asked the kind folks who work on the mlc project and they said the python client is currently designed for chat, such that they have this system prompt that is hard coded for llama models:
conv.system =
("[INST] <<SYS>>\n\nYou are a helpful, respectful and honest assistant. "
"Always answer as helpfully as possible, while being safe. "
"Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, "
"or illegal content. "
"Please ensure that your responses are socially unbiased and positive in nature.\n\n"
"If a question does not make any sense, or is not factually coherent, explain why instead "
"of answering something not correct. "
"If you don't know the answer to a question, please don't share false "
"information.\n<</SYS>>\n\n ");
If you want to fix this, you must edit mlc-chat-config.json, changing conv_template to LM. These docs say more about the config.json.
The config file is located in ./dist/<model-name>/params/mlc-chat-config.json. For example:
> cat ./dist/Llama-2-7b-hf-q4f16_1/params/mlc-chat-config.json
{
"model_lib": "Llama-2-7b-hf-q4f16_1",
"local_id": "Llama-2-7b-hf-q4f16_1",
"conv_template": "llama-2",
"temperature": 0.7,
"repetition_penalty": 1.0,
"top_p": 0.95,
"mean_gen_len": 128,
"max_gen_len": 512,
"shift_fill_factor": 0.3,
"tokenizer_files": [
"tokenizer.json",
"tokenizer.model"
],
"model_category": "llama",
"model_name": "Llama-2-7b-hf"
}