diff --git a/README.md b/README.md index e5892e9f..d0d323a4 100644 --- a/README.md +++ b/README.md @@ -185,7 +185,7 @@ Compared to ChatGLM's [P-Tuning](https://github.com/THUDM/ChatGLM2-6B/tree/main/ | [Qwen2-VL](https://huggingface.co/Qwen) | 2B/7B | qwen2_vl | | [StarCoder 2](https://huggingface.co/bigcode) | 3B/7B/15B | - | | [XVERSE](https://huggingface.co/xverse) | 7B/13B/65B | xverse | -| [Yi/Yi-1.5](https://huggingface.co/01-ai) | 6B/9B/34B | yi | +| [Yi/Yi-1.5 (Code)](https://huggingface.co/01-ai) | 1.5B/6B/9B/34B | yi | | [Yi-VL](https://huggingface.co/01-ai) | 6B/34B | yi_vl | | [Yuan 2](https://huggingface.co/IEITYuan) | 2B/51B/102B | yuan | diff --git a/README_zh.md b/README_zh.md index f22a52ef..2372dd0d 100644 --- a/README_zh.md +++ b/README_zh.md @@ -186,7 +186,7 @@ https://github.com/user-attachments/assets/e6ce34b0-52d5-4f3e-a830-592106c4c272 | [Qwen2-VL](https://huggingface.co/Qwen) | 2B/7B | qwen2_vl | | [StarCoder 2](https://huggingface.co/bigcode) | 3B/7B/15B | - | | [XVERSE](https://huggingface.co/xverse) | 7B/13B/65B | xverse | -| [Yi/Yi-1.5](https://huggingface.co/01-ai) | 6B/9B/34B | yi | +| [Yi/Yi-1.5 (Code)](https://huggingface.co/01-ai) | 1.5B/6B/9B/34B | yi | | [Yi-VL](https://huggingface.co/01-ai) | 6B/34B | yi_vl | | [Yuan 2](https://huggingface.co/IEITYuan) | 2B/51B/102B | yuan | diff --git a/src/llamafactory/data/mm_plugin.py b/src/llamafactory/data/mm_plugin.py index 33ab1328..def2c156 100644 --- a/src/llamafactory/data/mm_plugin.py +++ b/src/llamafactory/data/mm_plugin.py @@ -105,7 +105,7 @@ def _get_mm_inputs( It holds num_patches == torch.prod(image_grid_thw) """ image_processor: "BaseImageProcessor" = getattr(processor, "image_processor") - input_dict = {"images": None, "videos": None} + input_dict = {"images": None} # default key if len(images) != 0: images = _regularize_images(images, processor) input_dict["images"] = images @@ -114,7 +114,7 @@ def _get_mm_inputs( videos = _regularize_videos(videos, processor) input_dict["videos"] = videos - if input_dict["images"] is not None or input_dict["videos"] is not None: + if input_dict.get("images", None) is not None or input_dict.get("videos", None) is not None: return image_processor(**input_dict, return_tensors="pt") else: return {} diff --git a/src/llamafactory/extras/constants.py b/src/llamafactory/extras/constants.py index 60940b34..27decebb 100644 --- a/src/llamafactory/extras/constants.py +++ b/src/llamafactory/extras/constants.py @@ -1633,6 +1633,18 @@ register_model_group( DownloadSource.DEFAULT: "01-ai/Yi-1.5-34B-Chat", DownloadSource.MODELSCOPE: "01ai/Yi-1.5-34B-Chat", }, + "Yi-Coder-1.5B": { + DownloadSource.DEFAULT: "01-ai/Yi-Coder-1.5B", + }, + "Yi-Coder-9B": { + DownloadSource.DEFAULT: "01-ai/Yi-Coder-9B", + }, + "Yi-Coder-1.5B-Chat": { + DownloadSource.DEFAULT: "01-ai/Yi-Coder-1.5B-Chat", + }, + "Yi-Coder-9B-Chat": { + DownloadSource.DEFAULT: "01-ai/Yi-Coder-9B-Chat", + }, }, template="yi", )