-
Notifications
You must be signed in to change notification settings - Fork 243
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
Why did the model not understand the previous conversations? #1551
Comments
They have a demo code (using InternVL-Chat) about multi-round multi-image conversation, but the demo only has images at inputs in the first round conversation. # multi-round multi-image conversation
pixel_values1 = load_image('./examples/image1.jpg', max_num=6).to(torch.bfloat16).cuda()
pixel_values2 = load_image('./examples/image2.jpg', max_num=6).to(torch.bfloat16).cuda()
pixel_values = torch.cat((pixel_values1, pixel_values2), dim=0)
question = " Describe the two pictures in detail" # Describe the two pictures in detail
response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=None, return_history=True)
print(question, response) I don't know whether internvl-chat supports interleaved text-and-image chat, so I write an issue asking this. You can wait their responses. When I compared the preprocess code with Internvl-demo, I found a bug in Lmdeploy, this line should be |
Yeah, I'm waiting, just another thing I forgot to tell you that the system prompt is not also not working. |
Hi @irexyc Do lmdeploy support for InternVL-Chat-V1-5? I don't know why it'sn't even understand the system message, I have a system message "Your name is Jerry" and ask "whats your name" is says my name is AI |
Have you tried this case with the huggingface transformers to perform the inference? |
@lvhan028 Yes, it works, can you please try it? i think its an issue |
The prompt looks fine with system in messages.
Could you provide the code and results that using transformers ? |
Checklist
Describe the bug
Why did the model not understand the previous conversations? I gave OpenGVLab/InternVL-Chat-V1-5 some previous conversations with some wrong answers and when I asked "Do you think that in all the previous conversations we had, your answers were correct?" It generated the wrong response and said that No previous conversations were given.
What's the problem?
Reproduction
Message:
[{'role': 'system', 'content': 'Your name is Alan'}, {'role': 'user', 'content': [{'type': 'text', 'text': 'What is this place?'}, {'type': 'image_url', 'image_url': {'url': 'https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg'}}]}, {'role': 'assistant', 'content': [{'type': 'text', 'text': "It's London"}]}, {'role': 'user', 'content': [{'type': 'text', 'text': 'What is this place?'}, {'type': 'image_url', 'image_url': {'url': 'https://cdn.britannica.com/68/170868-050-8DDE8263/Golden-Gate-Bridge-San-Francisco.jpg'}}]}, {'role': 'assistant', 'content': [{'type': 'text', 'text': "It's Delhi"}]}, {'role': 'user', 'content': [{'type': 'text', 'text': 'Do you think that in all the previous conversations we had, your answers were correct? If not, where were these images taken?'}, {'type': 'image_url', 'image_url': {'url': 'https://cdn.britannica.com/59/94459-050-DBA42467/Skyline-Chicago.jpg'}}]}]
Code:
I'm building the package from GitHub
The text was updated successfully, but these errors were encountered: