[GH-ISSUE #141] Redundant LLM Response #120

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

Originally created by @aastha78 on GitHub (Jul 23, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-VL2/issues/141

for my code here :

def deepseek_predict( prompt, image_paths) :

if prompt.count("<image>") != len(image_paths):
    raise ValueError("Number of <image> tokens in prompt must match number of image paths provided.")

conversation = [
    {
        "role": "<|User|>",
        "content": prompt,
        "images": image_paths,
    },
    {"role": "<|Assistant|>", "content": ""}
]


pil_images = load_pil_images(conversation)

inputs = vl_chat_processor(
    conversations=conversation,
    images=pil_images,
    force_batchify=True,
    system_prompt=""
).to(vl_gpt.device)

inputs_embeds = vl_gpt.prepare_inputs_embeds(**inputs)

with torch.no_grad():
    outputs = vl_gpt.language.generate(
            inputs_embeds=inputs_embeds,
            attention_mask=inputs.attention_mask,
            pad_token_id=tokenizer.eos_token_id,
            bos_token_id=tokenizer.bos_token_id,
            eos_token_id=tokenizer.eos_token_id,
            max_new_tokens=8192,
            do_sample=True,
            use_cache=True,
            temperature=0.1,
            top_p=0.0,
            repetition_penalty=1.1)

response = tokenizer.decode(outputs[0].tolist(), skip_special_tokens=False)
return  response

i am getting this response from LLM :

\n-format (e.given the following the model**: \n-1** or is not the product?\n\n#### \n\n---\n\n####\n\n####\n-\n- objectivection:\n-\n-\n- object\n-\n- object\n- object\n-\n- object\n-\n-\n-\n- object\n-\n-\n- object\n- object\n-\n-\n-\n-\n- object?\n\n####\n-\n\n####\n- object, object\n- object\n- object\n-\n- object\n-\n- object\n-\n- object\n- object\n-\n-\n- object\n-\n- object\n- object\n- object\n-\n-\n-\n-\n- object\n-\n- object\n-\n- object\n-\n- object\n-\n- object\n-\n- object\n- object\n-\n-\n- object\n- object\n- object\n-\n- object\n- object\n-\n-\n- object\n-\n-\n- object\n-\n- object\n-\n- object\n-\n- object\n-\n- object\n- object\n-\n-\n- object\n-\n- object\n-\n- object\n- object\n- object\n-\n- object\n- object\n-\n- object\n- object\n-\n- object\n-\n- object\n- object\n-\n-\n- object\n-\n- object\n- object\n-\n- object\n\n<container**\n- object\n- object\n- object\n- object\n- object\n- object

my prompt is fine , i sent 10 images along my prompt with proper image tokens.

Originally created by @aastha78 on GitHub (Jul 23, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-VL2/issues/141 for my code here : def deepseek_predict( prompt, image_paths) : if prompt.count("<image>") != len(image_paths): raise ValueError("Number of <image> tokens in prompt must match number of image paths provided.") conversation = [ { "role": "<|User|>", "content": prompt, "images": image_paths, }, {"role": "<|Assistant|>", "content": ""} ] pil_images = load_pil_images(conversation) inputs = vl_chat_processor( conversations=conversation, images=pil_images, force_batchify=True, system_prompt="" ).to(vl_gpt.device) inputs_embeds = vl_gpt.prepare_inputs_embeds(**inputs) with torch.no_grad(): outputs = vl_gpt.language.generate( inputs_embeds=inputs_embeds, attention_mask=inputs.attention_mask, pad_token_id=tokenizer.eos_token_id, bos_token_id=tokenizer.bos_token_id, eos_token_id=tokenizer.eos_token_id, max_new_tokens=8192, do_sample=True, use_cache=True, temperature=0.1, top_p=0.0, repetition_penalty=1.1) response = tokenizer.decode(outputs[0].tolist(), skip_special_tokens=False) return response i am getting this response from LLM : **\n-format** (e.given the following the model**: \n-1** or **is** **not** the product?**\n\n#### \n\n---\n\n####\n\n####\n-**\n- **objectivection**:\n-**\n-**\n- **object**\n-**\n- **object**\n- **object**\n-**\n- **object**\n-**\n-**\n-**\n- **object**\n-**\n-**\n- **object**\n- **object**\n-**\n-**\n-**\n-**\n- **object?**\n\n####\n-**\n\n####\n- **object**, **object**\n- **object**\n- **object**\n-**\n- **object**\n-**\n- **object**\n-**\n- **object**\n- **object**\n-**\n-**\n- **object**\n-**\n- **object**\n- **object**\n- **object**\n-**\n-**\n-**\n-**\n- **object**\n-**\n- **object**\n-**\n- **object**\n-**\n- **object**\n-**\n- **object**\n-**\n- **object**\n- **object**\n-**\n-**\n- **object**\n- **object**\n- **object**\n-**\n- **object**\n- **object**\n-**\n-**\n- **object**\n-**\n-**\n- **object**\n-**\n- **object**\n-**\n- **object**\n-**\n- **object**\n-**\n- **object**\n- **object**\n-**\n-**\n- **object**\n-**\n- **object**\n-**\n- **object**\n- **object**\n- **object**\n-**\n- **object**\n- **object**\n-**\n- **object**\n- **object**\n-**\n- **object**\n-**\n- **object**\n- **object**\n-**\n-**\n- **object**\n-**\n- **object**\n- **object**\n-**\n- **object**\n\n<container**\n- **object**\n- **object**\n- **object**\n- **object**\n- **object**\n- **object** my prompt is fine , i sent 10 images along my prompt with proper image tokens.
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#120
No description provided.