Skip to content

Networks

Reference information for the multimodal Networks API.

Model Registry

eva.multimodal.models.networks.model_registry = Registry() module-attribute

Pre-configured Models

eva.multimodal.models.networks.Claude35Sonnet20240620

Bases: _Claude

Claude 3.5 Sonnet (June 2024) model.

Source code in src/eva/multimodal/models/networks/api/anthropic.py
def __init__(self, system_prompt: str | None = None):
    """Initialize the model."""
    super().__init__(model_name="claude-3-5-sonnet-20240620", system_prompt=system_prompt)

eva.multimodal.models.networks.Claude37Sonnet20250219

Bases: _Claude

Claude 3.7 Sonnet (February 2025) model.

Source code in src/eva/multimodal/models/networks/api/anthropic.py
def __init__(self, system_prompt: str | None = None):
    """Initialize the model."""
    super().__init__(model_name="claude-3-7-sonnet-20250219", system_prompt=system_prompt)

eva.multimodal.models.networks.PathoR13b

Bases: HuggingFaceModel

Patho-R1-3B model by Wenchuan Zhang.

Source code in src/eva/multimodal/models/networks/others.py
def __init__(
    self,
    system_prompt: str | None = None,
    cache_dir: str | None = None,
    attn_implementation: str = "flash_attention_2",
):
    """Initialize the Patho-R1-3B model."""
    requirements.check_min_versions(requirements={"torch": "2.5.1", "torchvision": "0.20.1"})

    if not os.getenv("HF_TOKEN"):
        raise ValueError("HF_TOKEN env variable must be set.")

    super().__init__(
        model_name_or_path="WenchuanZhang/Patho-R1-3B",
        model_class="Qwen2_5_VLForConditionalGeneration",
        model_kwargs={
            "torch_dtype": torch.float16,
            "trust_remote_code": True,
            "cache_dir": cache_dir,
            "attn_implementation": attn_implementation,
        },
        generation_kwargs={
            "max_new_tokens": 512,
            "do_sample": False,
        },
        processor_kwargs={
            "padding": True,
            "padding_side": "left",
            "max_pixels": 451584,  # 672*672
        },
        system_prompt=system_prompt,
    )

eva.multimodal.models.networks.Qwen25VL7BInstruct

Bases: HuggingFaceModel

Qwen2.5-VL 7B Instruct model.

Source code in src/eva/multimodal/models/networks/alibaba.py
def __init__(
    self,
    system_prompt: str | None = None,
    cache_dir: str | None = None,
    attn_implementation: str = "flash_attention_2",
):
    """Initialize the model."""
    super().__init__(
        model_name_or_path="Qwen/Qwen2.5-VL-7B-Instruct",
        model_class="Qwen2_5_VLForConditionalGeneration",
        model_kwargs={
            "torch_dtype": torch.bfloat16,
            "trust_remote_code": True,
            "cache_dir": cache_dir,
            "attn_implementation": attn_implementation,
        },
        generation_kwargs={
            "max_new_tokens": 512,
            "do_sample": False,
        },
        processor_kwargs={
            "padding": True,
            "padding_side": "left",
            "max_pixels": 451584,  # 672*672
        },
        system_prompt=system_prompt,
    )