本章节以LLaMA3.1 70B模型为例,简单介绍Multi-Lora如何使用。
cd ${基础模型权重} vi lora_adapter.json # 在此文件中配置adapter名称及路径,示例: {"adapter1": "${Lora权重1路径}", "adapter2": "${Lora权重2路径}"}
cd ${mindie-service安装路径} vi conf/config.json ./bin/mindieservice_daemon
其中"model"参数可以设置为模型权重路径或lora_adapter.json中配置的adapter名称。当"model"参数为模型权重路径时,不使用Lora权重进行推理。当"model"参数为lora_adapter.json中配置的adapter名称时,启用基础模型权重和指定的Lora权重进行推理。
curl https://127.0.0.1:1025/generate \ -H "Content-Type: application/json" \ --cacert ca.pem --cert client.pem --key client.key.pem \ -X POST \ -d '{ "model": "${基础模型权重}", "prompt": "Taxation in Puerto Rico -- The Commonwealth government has its own tax laws and Puerto Ricans are also required to pay some US federal taxes, although most residents do not have to pay the federal personal income tax. In 2009, Puerto Rico paid $3.742 billion into the US Treasury. Residents of Puerto Rico pay into Social Security, and are thus eligible for Social Security benefits upon retirement. However, they are excluded from the Supplemental Security Income.\nQuestion: is federal income tax the same as social security?\nAnswer:", "max_tokens": 20, "temperature": 0 }' curl https://127.0.0.1:1025/generate \ -H "Content-Type: application/json" \ --cacert ca.pem --cert client.pem --key client.key.pem \ -X POST \ -d '{ "model": "adapter1", "prompt": "Taxation in Puerto Rico -- The Commonwealth government has its own tax laws and Puerto Ricans are also required to pay some US federal taxes, although most residents do not have to pay the federal personal income tax. In 2009, Puerto Rico paid $3.742 billion into the US Treasury. Residents of Puerto Rico pay into Social Security, and are thus eligible for Social Security benefits upon retirement. However, they are excluded from the Supplemental Security Income.\nQuestion: is federal income tax the same as social security?\nAnswer:", "max_tokens": 20, "temperature": 0 }'