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

[mypy] Pass type checking in vllm/inputs #11680

Merged
merged 15 commits into from
Jan 2, 2025
Prev Previous commit
Next Next commit
fix typeguard types
Signed-off-by: Tobias Pitters <tobias.pitters@gmail.com>
  • Loading branch information
CloseChoice committed Jan 2, 2025
commit 08788b7488aa0f807516ac14d52c60e876ff382d
6 changes: 3 additions & 3 deletions vllm/inputs/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class TokenInputs(TypedDict):

def is_token_inputs(
inputs: Union[TokenInputs,
MultiModalInputsV2]) -> TypeGuard[TokenInputs]:
"MultiModalInputsV2"]) -> TypeGuard[TokenInputs]:
"""
Helper function to make sure mypy narrows down the type to
TokenInputs.
Expand All @@ -188,8 +188,8 @@ def is_token_inputs(


def is_multimodal_inputs(
inputs: Union[TokenInputs, MultiModalInputsV2]
) -> TypeGuard[MultiModalInputsV2]:
inputs: Union[TokenInputs, "MultiModalInputsV2"]
) -> TypeGuard["MultiModalInputsV2"]:
Copy link
Member

Choose a reason for hiding this comment

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

Same comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

"""
Helper function to make sure mypy narrows down the type to
MultiModalInputsV2.
Expand Down
Loading