[Model] Support Cohere2ForCausalLM (Cohere R7B) (#11203)

This commit is contained in:
Jani Monoses
2024-12-16 11:56:19 +02:00
committed by GitHub
parent b3b1526f03
commit bddbbcb132
5 changed files with 26 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
from unittest.mock import patch
import pytest
import transformers
from transformers import PretrainedConfig
from vllm import LLM
@@ -11,6 +12,9 @@ from .registry import HF_EXAMPLE_MODELS
@pytest.mark.parametrize("model_arch", HF_EXAMPLE_MODELS.get_supported_archs())
def test_can_initialize(model_arch):
model_info = HF_EXAMPLE_MODELS.get_hf_info(model_arch)
if (model_arch == "Cohere2ForCausalLM"
and transformers.__version__ < "4.48.0"):
pytest.skip(reason="Model introduced in HF >= 4.48.0")
if not model_info.is_available_online:
pytest.skip("Model is not available online")