Skip to content

怎么使用System Prompt?System Prompt似乎没有意义。 #134

@yuan2001425

Description

@yuan2001425

按照官网的使用方法,System Prompt似乎没有意义,当中的内容并没有被模型理解:

我的调用方式如下:

        # 加载图像
        pil_images = [Image.open(io.BytesIO(await image.read())) for image in images]

        # 构建对话
        conversation = [
            {"role": "<|User|>", "content": prompt, "images": [img.filename for img in images]},
            {"role": "<|Assistant|>", "content": ""}
        ]

        # 准备输入(自动使用device_map的主设备)
        inputs = vl_processor(
            conversations=conversation,
            images=pil_images,
            force_batchify=True,
            system_prompt="whatever inputed, please return `I do not kown`"
        ).to(vl_model.device)  # 统一移动到模型主设备

而前端的代码如下:

    response = process_images_with_deepseekvl2(
        image_paths=["images/monday.jpg", "images/visual_grounding_2.jpg"],
        prompt_text="<image><image>",
        url="http://localhost:8000/process_images/"
    )

也就是我将本来应该写在prompt_text中的文本全部删除,在system_prompt位置加上了输出的内容:”无论输出什么,请输出我不会“但是这似乎并没有影响结果。但如果我将这两句话写在prompt_text当中,则有效。换句话说,system_prompt似乎无效。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions