Skip to content

Commit

Permalink
Fix mypy type error (local format is passing)
Browse files Browse the repository at this point in the history
Signed-off-by: Flavia Beo <[email protected]>
  • Loading branch information
flaviabeo committed Oct 29, 2024
1 parent f330d01 commit 0739409
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vllm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def _verify_bnb_config(self) -> None:
self.enforce_eager = True

def get_pooling_type(self,
pooling_type_name: str) -> Optional[PoolingType]:
pooling_type_name: str) -> Union[PoolingType, None]:
pooling_types = {i.name: i for i in PoolingType}
return pooling_types.get(pooling_type_name)

Expand All @@ -433,8 +433,8 @@ def get_pooling_config(
pooling_type = self.get_pooling_type(
pooling_config["pooling_type"])
normalize = pooling_config["normalize"]
pooling_config = PoolingConfig(
pooling_type=PoolingType(pooling_type), normalize=normalize)
pooling_config = PoolingConfig(pooling_type=pooling_type,

Check failure on line 436 in vllm/config.py

View workflow job for this annotation

GitHub Actions / mypy (3.8)

Argument "pooling_type" to "PoolingConfig" has incompatible type "Optional[PoolingType]"; expected "PoolingType" [arg-type]

Check failure on line 436 in vllm/config.py

View workflow job for this annotation

GitHub Actions / mypy (3.9)

Argument "pooling_type" to "PoolingConfig" has incompatible type "Optional[PoolingType]"; expected "PoolingType" [arg-type]

Check failure on line 436 in vllm/config.py

View workflow job for this annotation

GitHub Actions / mypy (3.10)

Argument "pooling_type" to "PoolingConfig" has incompatible type "Optional[PoolingType]"; expected "PoolingType" [arg-type]

Check failure on line 436 in vllm/config.py

View workflow job for this annotation

GitHub Actions / mypy (3.11)

Argument "pooling_type" to "PoolingConfig" has incompatible type "Optional[PoolingType]"; expected "PoolingType" [arg-type]

Check failure on line 436 in vllm/config.py

View workflow job for this annotation

GitHub Actions / mypy (3.12)

Argument "pooling_type" to "PoolingConfig" has incompatible type "Optional[PoolingType]"; expected "PoolingType" [arg-type]
normalize=normalize)
if pooling_type_arg is not None:
pooling_config.pooling_type = self.get_pooling_type(
pooling_type_arg)
Expand Down

0 comments on commit 0739409

Please sign in to comment.