File size: 624 Bytes
e6828c9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from abc import ABC, abstractmethod
import torch

from models.base import (BaseAnswer,
                         AnswerResult)


class MultimodalAnswerResult(AnswerResult):
    image: str = None


class LavisBlip2Multimodal(BaseAnswer, ABC):

    @property
    @abstractmethod
    def _blip2_instruct(self) -> any:
        """Return _blip2_instruct of blip2."""

    @property
    @abstractmethod
    def _image_blip2_vis_processors(self) -> dict:
        """Return _image_blip2_vis_processors of blip2 image processors."""

    @abstractmethod
    def set_image_path(self, image_path: str):
        """set set_image_path"""