-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[Frontend] Factor out chat message parsing #7055
Conversation
👋 Hi! Thank you for contributing to the vLLM project. Once the PR is approved and ready to go, please make sure to run full CI as it is required to merge (or just use auto-merge). To run full CI, you can do one of these:
🚀 |
result = parse_chat_message_content(message, model_config, | ||
tokenizer) | ||
conversation.extend(result.messages) | ||
if mm_futures: |
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.
QQ: should we warn only once? (I think there's a function like warn_once) it is not going to be spammy?
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.
Good point! It's unlikely to be an issue since we have explicitly mentioned that we're only supporting single-image input currently, but yea I agree we should use warn_once here!
nvm - the warning here is actually different than what I thought, yea we should put warn_once
here
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.
Actually, the default behaviour already does this (i.e. only print out the first occurrence of the warning).
https://docs.python.org/3/library/warnings.html#the-warnings-filter
Signed-off-by: Alvant <alvasian@yandex.ru>
To further support #5049, I've factored out more code relating to chat message parsing into
chat_utils.py