Skip to content

Commit

Permalink
v1: tell mypy to ignore erros with msgspec.Struct kwargs
Browse files Browse the repository at this point in the history
As per the similar v0 code.

Fixes:

vllm/v1/engine/__init__.py:46: error: Unexpected keyword argument "array_like" for "__init_subclass__" of "object"  [call-arg]
vllm/v1/engine/__init__.py:46: error: Unexpected keyword argument "omit_defaults" for "__init_subclass__" of "object"  [call-arg]
vllm/v1/engine/__init__.py:46: error: Unexpected keyword argument "gc" for "__init_subclass__" of "object"  [call-arg]
vllm/v1/engine/__init__.py:58: error: Unexpected keyword argument "array_like" for "__init_subclass__" of "object"  [call-arg]
vllm/v1/engine/__init__.py:58: error: Unexpected keyword argument "omit_defaults" for "__init_subclass__" of "object"  [call-arg]
vllm/v1/engine/__init__.py:58: error: Unexpected keyword argument "gc" for "__init_subclass__" of "object"  [call-arg]

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
  • Loading branch information
markmc committed Dec 11, 2024
1 parent 910a630 commit f339531
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions vllm/v1/engine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ class EngineCoreRequest:
lora_request: Optional[LoRARequest]


class EngineCoreOutput(msgspec.Struct,
array_like=True,
omit_defaults=True,
gc=False):
class EngineCoreOutput(
msgspec.Struct,
array_like=True, # type: ignore[call-arg]
omit_defaults=True, # type: ignore[call-arg]
gc=False): # type: ignore[call-arg]

request_id: str
new_token_ids: List[int]
Expand All @@ -55,10 +56,11 @@ class EngineCoreOutput(msgspec.Struct,
stop_reason: Union[int, str, None] = None


class EngineCoreOutputs(msgspec.Struct,
array_like=True,
omit_defaults=True,
gc=False):
class EngineCoreOutputs(
msgspec.Struct,
array_like=True, # type: ignore[call-arg]
omit_defaults=True, # type: ignore[call-arg]
gc=False): # type: ignore[call-arg]

#NOTE(Nick): We could consider ways to make this more compact,
# e.g. columnwise layout and using an int enum for finish/stop reason
Expand Down

0 comments on commit f339531

Please sign in to comment.