Skip to content

Commit f58f49f

Browse files
committed
Fix typing errors
1 parent bd5ba81 commit f58f49f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

vllm/entrypoints/openai/api_server.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767

6868

6969
def model_is_embedding(model_name: str, trust_remote_code: bool,
70-
quantization: str) -> bool:
70+
quantization: Optional[str]) -> bool:
7171
return ModelConfig(model=model_name,
7272
tokenizer=model_name,
7373
tokenizer_mode="auto",
@@ -108,7 +108,7 @@ async def build_async_engine_client(
108108
async with build_async_engine_client_from_engine_args(
109109
engine_args, args.disable_frontend_multiprocessing) as engine:
110110

111-
async_engine_client = engine
111+
async_engine_client = engine # type: ignore[assignment]
112112
yield engine
113113

114114

@@ -189,7 +189,7 @@ async def build_async_engine_client_from_engine_args(
189189
yield None
190190
return
191191

192-
yield rpc_client
192+
yield rpc_client # type: ignore[misc]
193193
finally:
194194
# Ensure rpc server process was terminated
195195
rpc_server_process.terminate()

vllm/entrypoints/openai/rpc/client.py

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import cloudpickle
88
import zmq
99
import zmq.asyncio
10+
from zmq import Frame # type: ignore[attr-defined]
1011
from zmq.asyncio import Socket
1112

1213
from vllm.config import (DecodingConfig, LoRAConfig, ModelConfig,
@@ -214,6 +215,7 @@ async def _send_get_data_rpc_request(self, request: RPCUtilityRequest,
214215

215216
# Await the data from the Server.
216217
frame = await socket.recv(copy=False)
218+
assert isinstance(frame, Frame)
217219
data = pickle.loads(frame.buffer)
218220

219221
if isinstance(data, Exception):
@@ -247,6 +249,7 @@ async def do_rpc_call(socket: Socket, request: RPC_REQUEST_TYPE):
247249
f"{self._data_timeout} ms")
248250

249251
frame = await socket.recv(copy=False)
252+
assert isinstance(frame, Frame)
250253
return pickle.loads(frame.buffer)
251254

252255
# Make a new socket connection.
@@ -395,6 +398,7 @@ async def generate(
395398
# Stream back the results from the RPC Server.
396399
while not finished:
397400
message = await socket.recv(copy=False)
401+
assert isinstance(message, Frame)
398402
request_output = pickle.loads(message.buffer)
399403

400404
if isinstance(request_output, Exception):

0 commit comments

Comments
 (0)