-
Notifications
You must be signed in to change notification settings - Fork 285
Run finish_chat() before start_chat() in VLM pipeline. #2470
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures that finish_chat()
is called before start_chat()
in both VLM and Continuous Batching pipelines to prevent accumulation of history images when multiple start_chat()
calls are made. This addresses ticket CVS-170106.
- Adds
finish_chat()
calls beforestart_chat()
in both pipeline implementations - Removes direct state reset code from VLM pipeline implementation, delegating cleanup to
finish_chat()
- Removes
m_image_id
reset from continuous batching base class
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/cpp/src/visual_language/pipeline.cpp | Adds finish_chat() call before start_chat() and removes inline state reset logic |
src/cpp/src/continuous_batching/pipeline_base.cpp | Removes m_image_id reset from base implementation |
src/cpp/src/continuous_batching/pipeline.cpp | Adds finish_chat() call before start_chat() |
if (!m_inputs_embedder->get_kv_cache_state().get_state().empty()) { | ||
m_history.clear(); | ||
} | ||
m_inputs_embedder->start_chat(system_message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the removal of state reset logic, ensure that finish_chat() properly handles all the cleanup that was previously done here, including m_image_id reset, state reset, attention_mask reshaping, and history clearing.
Copilot uses AI. Check for mistakes.
c7d56b4
Run finish_chat() before start_chat() in VLM pipeline and CB pipeline to prevent accumulating of history images when multiple start_chat() are used.
Ticket: CVS-170106