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

Update async_engine.py � checking #697

Closed
wants to merge 1 commit into from
Closed

Update async_engine.py � checking #697

wants to merge 1 commit into from

Conversation

Spockhh
Copy link

@Spockhh Spockhh commented Nov 16, 2023

� can appear in anywhere of a block in a stream.

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily receiving feedbacks. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

The out put of the stream can contain � at other places other than end of the block. To avoid that, need to use operator 'in'.

Modification

changed if response.endwith('�') to if '�' in response

BC-breaking (Optional)

Does the modification introduce changes that break the backward-compatibility of the downstream repositories?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.

Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness.
  3. If the modification has a dependency on downstream projects of a newer version, this PR should be tested with all supported versions of downstream projects.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

� can appear in anywhere of a block in a stream.
@lvhan028
Copy link
Collaborator

LMDeploy decode token_id one by one. Is it possible that � character in the middle of decoded text? @AllentDan

@lvhan028 lvhan028 requested a review from AllentDan November 17, 2023 07:09
@Spockhh
Copy link
Author

Spockhh commented Nov 17, 2023

LMDeploy decode token_id one by one. Is it possible that � character in the middle of decoded text? @AllentDan

Even that's true, the token itself, after decoding, may contains the � middle ?

@lvhan028
Copy link
Collaborator

@AllentDan
Copy link
Collaborator

No, it does not. Only appears at the head and tail of a sequence piece. And in the head means there should be another in the tail of the previous piece.

@Spockhh
Copy link
Author

Spockhh commented Nov 17, 2023

No, I think it will not. https://github.com/vllm-project/vllm/blob/0fc280b06cd0cc562281b55b0b70248b119f575b/vllm/transformers_utils/tokenizer.py#L161 Have you really met a case?

yes, I have met the endwith dosen't work.

@AllentDan
Copy link
Collaborator

Did you solve the bug by replacing endswith with in? It's more likely an unexpected token id that the tokenizer can not handle. Rather than cased by incremental decoding.

@Spockhh
Copy link
Author

Spockhh commented Nov 17, 2023

Did you solve the bug by replacing endswith with in? It's more likely an unexpected token id that the tokenizer can not handle. Rather than cased by incremental decoding.

yes it solved the issue.

@AllentDan
Copy link
Collaborator

Please give some details for us to reproduce the bug and test the PR.

@lvhan028 lvhan028 added the Stale label Nov 21, 2023
@lvhan028 lvhan028 closed this Nov 21, 2023
@lvhan028
Copy link
Collaborator

Feel free to reopen this PR if a failure case is found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants