File size: 622 Bytes
d5436e0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from abc import ABC, abstractmethod
from typing import Dict, Optional


class LLMInterface(ABC):
    @abstractmethod
    def execution(self):
        """Method execution LLM model based on HuggingFace or Langchain"""
        pass

    # {"model_name": "./models/model_name"}
    @abstractmethod
    def clear_llm(self, unused_model_dict: Optional[Dict[str, str]], current_lc: str) -> None:
        """Method clear unused LLM"""
        pass

    @abstractmethod
    def get_unused(self, current_lc: str) -> Optional[Dict[str, str]]:
        """Method getting LLM that unused and forming corresponding dict"""
        pass