File size: 666 Bytes
80ceab0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ef7643d
 
 
 
 
 
 
 
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
from abc import ABC, abstractmethod
from typing import Dict, Optional, Union, Any


class BaseVideoModel(ABC):
    def __init__(self, model_name: str):
        self.model_name = model_name
        self.model = None
        self.processor = None

    @abstractmethod
    def chat(
        self,
        prompt: str,
        video_path: str,
        generation_config: Optional[Dict[str, Any]] = None,
    ) -> str:
        pass

    # @abstractmethod
    # def chat_with_confidence(
    #     self,
    #     prompt: str,
    #     video_path: str,
    #     generation_config: Optional[Dict[str, Any]] = None,
    # ) -> Dict[str, Union[str, float]]:
    #     pass