昇腾社区首页
中文
注册

使用样例

限制与约束

  • Atlas 800I A2 推理产品Atlas 300I Duo 推理卡支持此特性。
  • 模型特性矩阵及相关文档请参考《MindIE是什么》的“MindIE支持模型列表 > 多模态理解模型列表”章节

操作步骤

本章节以qwen-vl模型为例,简单介绍多模态如何使用。

更多多模态的使用详情请参见EndPoint业务面RESTful接口章节。

  1. 安装多模态模型依赖。
    cd /usr/local/Ascend/llm_model/requirements/models  # mindIE安装包默认路径
    pip install -r requirements_qwen_vl.txt
  2. 下载基础模型权重后,配置服务化参数config.json文件,然后启动服务化,服务化参数说明请参见配置参数说明章节。
    cd ${mindie-service安装路径}
    vi conf/config.json  # 配置模型参数"modelName"、"modelWeightPath"等
    ./bin/mindieservice_daemon
  3. 使用以下指令发送请求,参数说明见文本/流式推理接口章节。
    curl https://127.0.0.11:1025/generate -H "Content-Type: application/json" --cacert ca.pem --cert client.pem  --key client.key.pem -X POST -d '{
        "prompt": [
            {"type": "text", "text": "What is in this image?"},
    	{ "type": "image_url", "image_url": "/xxx/test.png"}
        ],
        "max_tokens": 100,
        "repetition_penalty": 1.03,
        "presence_penalty": 1.2,
        "frequency_penalty": 1.2,
        "temperature": 0.5,
        "top_k": 10,
        "top_p": 0.95
    }'