[Model] merged input processor for Phi-3-Vision models (#10977)

Signed-off-by: Isotr0py <2037008807@qq.com>
Co-authored-by: Cyrus Leung <cyrus.tl.leung@gmail.com>
This commit is contained in:
Isotr0py
2024-12-09 12:55:10 -08:00
committed by GitHub
co-authored by Cyrus Leung
parent ca871491ed
commit a811dd6608
7 changed files with 234 additions and 408 deletions
+2 -2
View File
@@ -69,12 +69,12 @@ class InputProcessingContext(InputContext):
tokenizer: AnyTokenizer
"""The tokenizer used to tokenize the inputs."""
def get_hf_processor(self) -> ProcessorMixin:
def get_hf_processor(self, **kwargs) -> ProcessorMixin:
return cached_get_processor(
self.model_config.tokenizer,
tokenizer=self.tokenizer, # Override the tokenizer with ours
trust_remote_code=self.model_config.trust_remote_code,
)
**kwargs)
N = TypeVar("N", bound=Type[nn.Module])