[Mypy] Better fixes for the mypy issues in vllm/config (#37902)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
@@ -8,7 +8,6 @@ the explicit/implicit prompt format on enc-dec LMMs for text generation.
|
||||
import os
|
||||
import time
|
||||
from collections.abc import Sequence
|
||||
from dataclasses import asdict
|
||||
from typing import NamedTuple
|
||||
|
||||
from vllm import LLM, EngineArgs, PromptType, SamplingParams
|
||||
@@ -91,13 +90,12 @@ def main(args):
|
||||
req_data = model_example_map[model]()
|
||||
|
||||
# Disable other modalities to save memory
|
||||
engine_args = req_data.engine_args
|
||||
default_limits = {"image": 0, "video": 0, "audio": 0}
|
||||
req_data.engine_args.limit_mm_per_prompt = default_limits | dict(
|
||||
req_data.engine_args.limit_mm_per_prompt or {}
|
||||
)
|
||||
|
||||
engine_args = asdict(req_data.engine_args) | {"seed": args.seed}
|
||||
llm = LLM(**engine_args)
|
||||
limit_mm_per_prompt = default_limits | (engine_args.limit_mm_per_prompt or {})
|
||||
engine_args.limit_mm_per_prompt = limit_mm_per_prompt
|
||||
engine_args.seed = args.seed
|
||||
llm = LLM.from_engine_args(engine_args)
|
||||
|
||||
prompts = req_data.prompts
|
||||
|
||||
|
||||
Reference in New Issue
Block a user