[Bugfix] Fix Ovis2_5 special tokens for transformers v5 (#47298)
Signed-off-by: mgrunwal <milosz.grunwald@intel.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
co-authored by
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Harry Mellor
parent
adfbbc1005
commit
3e0c887511
@@ -402,12 +402,11 @@ class Ovis2_5MultiModalProcessor(BaseMultiModalProcessor[Ovis2_5ProcessingInfo])
|
||||
hf_processor_mm_kwargs: Mapping[str, object],
|
||||
out_mm_kwargs: MultiModalKwargsItems,
|
||||
) -> list[PromptReplacement]:
|
||||
tokenizer = self.info.get_tokenizer()
|
||||
vocab = tokenizer.get_vocab()
|
||||
hf_processor = self.info.get_hf_processor()
|
||||
|
||||
placeholder = {
|
||||
"image": vocab[IMAGE_TOKEN],
|
||||
"video": vocab[VIDEO_TOKEN],
|
||||
"image": hf_processor.get_token_value("image_token"),
|
||||
"video": hf_processor.get_token_value("video_token"),
|
||||
}
|
||||
|
||||
def get_replacement_ovis(item_idx, modality: str):
|
||||
|
||||
Reference in New Issue
Block a user