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

fill prompt for sampler analysis with real tokens in VLM pipeline #1247

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sbalandi
Copy link
Contributor

No description provided.

@github-actions github-actions bot added the category: visual language Visual language pipeline label Nov 22, 2024
auto chat_history = m_inputs_embedder->get_tokenized_chat_history();
size_t chat_history_size = std::max(chat_history.get_shape().at(1), history_size + inputs_embeds_size);
ov::Tensor prompt_ids(ov::element::i64, { chat_history_size });
std::fill_n(prompt_ids.data<int64_t>(), prompt_ids.get_size(), 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 1 is used as default value? maybe pad_token ?

std::fill_n(prompt_ids.data<int64_t>(), prompt_ids.get_size(), 0);

auto chat_history = m_inputs_embedder->get_tokenized_chat_history();
size_t chat_history_size = std::max(chat_history.get_shape().at(1), history_size + inputs_embeds_size);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like we have the same case as for LLMs, when decode ( encode ( X ) ) provides smaller value than X ?
in this case we need to partially re-compute the history.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in general, I would consider merging VLM and LLM pipelines generate functions to keep all this magic with history in one place.
Or at least to create helper function similar to get_lm_encoded_results

@ilya-lavrenov ilya-lavrenov added this to the 2025.0 milestone Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: visual language Visual language pipeline
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants