Download efficient_context/compression/base.py from biswanathroul/efficient-context: direct link, hf CLI and curl.
- Browser
- Download file 649 Bytes
-
https://huggingface.co/biswanathroul/efficient-context/resolve/main/efficient_context/compression/base.py
- Command line
-
hf download hf://biswanathroul/efficient-context/efficient_context/compression/base.py
-
curl -L -o base.py https://huggingface.co/biswanathroul/efficient-context/resolve/main/efficient_context/compression/base.py
649 Bytes
| """ | |
| Base classes for context compression components. | |
| """ | |
| from abc import ABC, abstractmethod | |
| from typing import Optional | |
| class BaseCompressor(ABC): | |
| """Base class for content compression components.""" | |
| def compress(self, content: str, target_size: Optional[int] = None) -> str: | |
| """ | |
| Compress content to reduce size while preserving key information. | |
| Args: | |
| content: The content to compress | |
| target_size: Optional target size for the compressed content | |
| Returns: | |
| compressed_content: The compressed content | |
| """ | |
| pass | |