|
10 | 10 | import textwrap |
11 | 11 | import warnings |
12 | 12 | from collections import Counter |
13 | | -from collections.abc import Mapping |
14 | 13 | from contextlib import contextmanager |
15 | 14 | from dataclasses import (MISSING, dataclass, field, fields, is_dataclass, |
16 | 15 | replace) |
@@ -355,7 +354,7 @@ def __init__( |
355 | 354 | disable_cascade_attn: bool = False, |
356 | 355 | skip_tokenizer_init: bool = False, |
357 | 356 | served_model_name: Optional[Union[str, list[str]]] = None, |
358 | | - limit_mm_per_prompt: Optional[Mapping[str, int]] = None, |
| 357 | + limit_mm_per_prompt: Optional[dict[str, int]] = None, |
359 | 358 | use_async_output_proc: bool = True, |
360 | 359 | config_format: ConfigFormat = ConfigFormat.AUTO, |
361 | 360 | hf_token: Optional[Union[bool, str]] = None, |
@@ -578,7 +577,7 @@ def maybe_pull_model_tokenizer_for_s3(self, model: str, |
578 | 577 | self.tokenizer = s3_tokenizer.dir |
579 | 578 |
|
580 | 579 | def _init_multimodal_config( |
581 | | - self, limit_mm_per_prompt: Optional[Mapping[str, int]] |
| 580 | + self, limit_mm_per_prompt: Optional[dict[str, int]] |
582 | 581 | ) -> Optional["MultiModalConfig"]: |
583 | 582 | if self.registry.is_multimodal_model(self.architectures): |
584 | 583 | return MultiModalConfig(limit_per_prompt=limit_mm_per_prompt or {}) |
@@ -2730,7 +2729,7 @@ def verify_with_model_config(self, model_config: ModelConfig): |
2730 | 2729 | class MultiModalConfig: |
2731 | 2730 | """Controls the behavior of multimodal models.""" |
2732 | 2731 |
|
2733 | | - limit_per_prompt: Mapping[str, int] = field(default_factory=dict) |
| 2732 | + limit_per_prompt: dict[str, int] = field(default_factory=dict) |
2734 | 2733 | """ |
2735 | 2734 | The maximum number of input items allowed per prompt for each modality. |
2736 | 2735 | This should be a JSON string that will be parsed into a dictionary. |
|
0 commit comments