diff --git a/src/llamafactory/data/mm_plugin.py b/src/llamafactory/data/mm_plugin.py index 215fe807..324b857f 100644 --- a/src/llamafactory/data/mm_plugin.py +++ b/src/llamafactory/data/mm_plugin.py @@ -552,9 +552,9 @@ class InternVLPlugin(BasePlugin): if len(images) != 0 or len(videos) != 0: pixel_values_list = _concatenate_list(image_video_patches) - mm_inputs["pixel_values"] = torch.stack( - [torch.tensor(patch_ndarray) for patch_ndarray in pixel_values_list] - ) + # in the latest version of transformers, + # the pixel_values is a list of tensors not ndarray + mm_inputs["pixel_values"] = torch.stack(pixel_values_list) if len(images) != 0: mm_inputs.update({"image_num_patches": image_num_patches}) diff --git a/src/llamafactory/extras/constants.py b/src/llamafactory/extras/constants.py index 025a8bbc..a26ed6c2 100644 --- a/src/llamafactory/extras/constants.py +++ b/src/llamafactory/extras/constants.py @@ -1002,33 +1002,37 @@ register_model_group( register_model_group( models={ - "InternVL2.5-1B-MPO": { - DownloadSource.DEFAULT: "kingsley01/InternVL2_5-1B-MPO-hf", - DownloadSource.MODELSCOPE: "llamafactory/InternVL2_5-1B-MPO-hf", - }, "InternVL2.5-2B-MPO": { - DownloadSource.DEFAULT: "kingsley01/InternVL2_5-2B-MPO-hf", - DownloadSource.MODELSCOPE: "llamafactory/InternVL2_5-2B-MPO-hf", - }, - "InternVL2.5-4B-MPO": { - DownloadSource.DEFAULT: "kingsley01/InternVL2_5-4B-MPO-hf", - DownloadSource.MODELSCOPE: "llamafactory/InternVL2_5-4B-MPO-hf", + DownloadSource.DEFAULT: "OpenGVLab/InternVL2_5-2B-MPO-hf", + DownloadSource.MODELSCOPE: "OpenGVLab/InternVL2_5-2B-MPO-hf", }, "InternVL2.5-8B-MPO": { - DownloadSource.DEFAULT: "kingsley01/InternVL2_5-8B-MPO-hf", - DownloadSource.MODELSCOPE: "llamafactory/InternVL2_5-8B-MPO-hf", + DownloadSource.DEFAULT: "OpenGVLab/InternVL2_5-8B-MPO-hf", + DownloadSource.MODELSCOPE: "OpenGVLab/InternVL2_5-8B-MPO-hf", }, "InternVL3-1B-hf": { - DownloadSource.DEFAULT: "kingsley01/InternVL3-1B-hf", - DownloadSource.MODELSCOPE: "llamafactory/InternVL3-1B-hf", + DownloadSource.DEFAULT: "OpenGVLab/InternVL3-1B-hf", + DownloadSource.MODELSCOPE: "OpenGVLab/InternVL3-1B-hf", }, "InternVL3-2B-hf": { - DownloadSource.DEFAULT: "kingsley01/InternVL3-2B-hf", - DownloadSource.MODELSCOPE: "llamafactory/InternVL3-2B-hf", + DownloadSource.DEFAULT: "OpenGVLab/InternVL3-2B-hf", + DownloadSource.MODELSCOPE: "OpenGVLab/InternVL3-2B-hf", }, "InternVL3-8B-hf": { - DownloadSource.DEFAULT: "kingsley01/InternVL3-8B-hf", - DownloadSource.MODELSCOPE: "llamafactory/InternVL3-8B-hf", + DownloadSource.DEFAULT: "OpenGVLab/InternVL3-8B-hf", + DownloadSource.MODELSCOPE: "OpenGVLab/InternVL3-8B-hf", + }, + "InternVL3-14B-hf": { + DownloadSource.DEFAULT: "OpenGVLab/InternVL3-14B-hf", + DownloadSource.MODELSCOPE: "OpenGVLab/InternVL3-14B-hf", + }, + "InternVL3-38B-hf": { + DownloadSource.DEFAULT: "OpenGVLab/InternVL3-38B-hf", + DownloadSource.MODELSCOPE: "OpenGVLab/InternVL3-38B-hf", + }, + "InternVL3-78B-hf": { + DownloadSource.DEFAULT: "OpenGVLab/InternVL3-78B-hf", + DownloadSource.MODELSCOPE: "OpenGVLab/InternVL3-78B-hf", }, }, template="intern_vl", diff --git a/tests/data/test_mm_plugin.py b/tests/data/test_mm_plugin.py index ef7d0257..a98e8f17 100644 --- a/tests/data/test_mm_plugin.py +++ b/tests/data/test_mm_plugin.py @@ -162,7 +162,7 @@ def test_gemma3_plugin(): @pytest.mark.xfail(reason="Unknown error.") def test_internvl_plugin(): image_seqlen = 256 - tokenizer_module = _load_tokenizer_module(model_name_or_path="kingsley01/InternVL2_5-1B-MPO-hf") + tokenizer_module = _load_tokenizer_module(model_name_or_path="OpenGVLab/InternVL3-1B-hf") internvl_plugin = get_mm_plugin("intern_vl", image_token="", video_token="