[GH-ISSUE #134] 怎么使用System Prompt?System Prompt似乎没有意义。 #113

Open
opened 2026-10-26 21:12:12 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @yuan2001425 on GitHub (May 1, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-VL2/issues/134

按照官网的使用方法,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似乎无效。

Originally created by @yuan2001425 on GitHub (May 1, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-VL2/issues/134 按照官网的使用方法,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似乎无效。
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepSeek-VL2#113
No description provided.