[mypy] Enable type checking for test directory (#5017)
This commit is contained in:
@@ -2,6 +2,7 @@ import argparse
|
||||
import asyncio
|
||||
import sys
|
||||
from io import StringIO
|
||||
from typing import Awaitable, List
|
||||
|
||||
import aiohttp
|
||||
|
||||
@@ -114,7 +115,7 @@ async def main(args):
|
||||
)
|
||||
|
||||
# Submit all requests in the file to the engine "concurrently".
|
||||
response_futures = []
|
||||
response_futures: List[Awaitable[BatchRequestOutput]] = []
|
||||
for request_json in (await read_file(args.input_file)).strip().split("\n"):
|
||||
request = BatchRequestInput.model_validate_json(request_json)
|
||||
response_futures.append(run_request(openai_serving_chat, request))
|
||||
|
||||
@@ -487,7 +487,7 @@ class OpenAIServingChat(OpenAIServing):
|
||||
final_res = res
|
||||
assert final_res is not None
|
||||
|
||||
choices = []
|
||||
choices: List[ChatCompletionResponseChoice] = []
|
||||
|
||||
role = self.get_chat_request_role(request)
|
||||
for output in final_res.outputs:
|
||||
|
||||
@@ -25,7 +25,7 @@ def request_output_to_embedding_response(
|
||||
created_time: int,
|
||||
model_name: str,
|
||||
) -> EmbeddingResponse:
|
||||
data = []
|
||||
data: List[EmbeddingResponseData] = []
|
||||
num_prompt_tokens = 0
|
||||
for idx, final_res in enumerate(final_res_batch):
|
||||
assert final_res is not None
|
||||
|
||||
Reference in New Issue
Block a user