Spaces:
Sleeping
Sleeping
Download src/stores/LLM/LLMInterface.py from mustaphaelkady/mini-rag: direct link, hf CLI and curl.
- Browser
- Download file 844 Bytes
-
https://huggingface.co/spaces/mustaphaelkady/mini-rag/resolve/main/src/stores/LLM/LLMInterface.py
- Command line
-
hf download hf://spaces/mustaphaelkady/mini-rag/src/stores/LLM/LLMInterface.py
-
curl -L -o LLMInterface.py https://huggingface.co/spaces/mustaphaelkady/mini-rag/resolve/main/src/stores/LLM/LLMInterface.py
844 Bytes
| from abc import ABC , abstractmethod | |
| class LLMInterface(ABC): | |
| # to force used this method | |
| def set_generation_model(self, model_id: str): | |
| pass | |
| def set_embedding_model(self, model_id: str, embeddig_size:int): | |
| pass | |
| def generate_text(self, prompt: str, max_output_token: int=None, | |
| chat_history: list=[],temperature: float = None): | |
| pass | |
| def embed_text(self, text: str, document_type: str= None ): | |
| pass | |
| def embed_text(self, texts: list, document_type: str = None): | |
| pass | |
| def construct_prompt(self, prompt: str, role: str): # call to handle prompt before generate text method usedit | |
| pass | |