File size: 777 Bytes
d425e71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""aya_vision.py.

File for providing the AyaVision model implementation.
"""

from transformers import AutoModelForImageTextToText

from src.models.base import ModelBase
from src.models.config import Config


class AyaVisionModel(ModelBase):
    """AyaVision model implementation."""

    def __init__(self, config: Config) -> None:
        """Initialization of the AyaVision model.

        Args:
            config (Config): Parsed config
        """
        # initialize the parent class
        super().__init__(config)

    def _load_specific_model(self) -> None:
        """Load the AyaVision model with proper configuration."""
        self.model = AutoModelForImageTextToText.from_pretrained(
            self.model_path, **getattr(self.config, 'model', {})
        )