|
7 | 7 | import cloudpickle
|
8 | 8 | import zmq
|
9 | 9 | import zmq.asyncio
|
| 10 | +from zmq import Frame # type: ignore[attr-defined] |
10 | 11 | from zmq.asyncio import Socket
|
11 | 12 |
|
12 | 13 | from vllm.config import (DecodingConfig, LoRAConfig, ModelConfig,
|
@@ -214,6 +215,7 @@ async def _send_get_data_rpc_request(self, request: RPCUtilityRequest,
|
214 | 215 |
|
215 | 216 | # Await the data from the Server.
|
216 | 217 | frame = await socket.recv(copy=False)
|
| 218 | + assert isinstance(frame, Frame) |
217 | 219 | data = pickle.loads(frame.buffer)
|
218 | 220 |
|
219 | 221 | if isinstance(data, Exception):
|
@@ -247,6 +249,7 @@ async def do_rpc_call(socket: Socket, request: RPC_REQUEST_TYPE):
|
247 | 249 | f"{self._data_timeout} ms")
|
248 | 250 |
|
249 | 251 | frame = await socket.recv(copy=False)
|
| 252 | + assert isinstance(frame, Frame) |
250 | 253 | return pickle.loads(frame.buffer)
|
251 | 254 |
|
252 | 255 | # Make a new socket connection.
|
@@ -395,6 +398,7 @@ async def generate(
|
395 | 398 | # Stream back the results from the RPC Server.
|
396 | 399 | while not finished:
|
397 | 400 | message = await socket.recv(copy=False)
|
| 401 | + assert isinstance(message, Frame) |
398 | 402 | request_output = pickle.loads(message.buffer)
|
399 | 403 |
|
400 | 404 | if isinstance(request_output, Exception):
|
|
0 commit comments