Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with add_vision_ids=True argument #716

Open
rajatguptakgp opened this issue Feb 4, 2025 · 0 comments
Open

Issue with add_vision_ids=True argument #716

rajatguptakgp opened this issue Feb 4, 2025 · 0 comments

Comments

@rajatguptakgp
Copy link

rajatguptakgp commented Feb 4, 2025

from transformers import AutoProcessor
processor = AutoProcessor.from_pretrained("Qwen2.5-VL-7B-Instruct")

transformers.__version__: '4.49.0.dev0'

I have copied the exact code mentioned below. The command prompt_without_id == prompt_with_id gives True. There is no effect of add_vision_id = True, argument.

conversation = [
    {
        "role": "user",
        "content": [{"type": "image"}, {"type": "text", "text": "Hello, how are you?"}],
    },
    {
        "role": "assistant",
        "content": "I'm doing well, thank you for asking. How can I assist you today?",
    },
    {
        "role": "user",
        "content": [
            {"type": "text", "text": "Can you describe these images and video?"},
            {"type": "image"},
            {"type": "image"},
            {"type": "video"},
            {"type": "text", "text": "These are from my vacation."},
        ],
    },
    {
        "role": "assistant",
        "content": "I'd be happy to describe the images and video for you. Could you please provide more context about your vacation?",
    },
    {
        "role": "user",
        "content": "It was a trip to the mountains. Can you see the details in the images and video?",
    },
]

# default:
prompt_without_id = processor.apply_chat_template(
    conversation, add_generation_prompt=True
)

# add ids
prompt_with_id = processor.apply_chat_template(
    conversation, add_generation_prompt=True, add_vision_id=True
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant