Spaces:
Build error
Build error
Download headroom/transforms/__init__.py from minhtudragon/headroom_3: direct link, hf CLI and curl.
- Browser
- Download file 3.14 kB
-
https://huggingface.co/spaces/minhtudragon/headroom_3/resolve/cd5ea2ea1d50b68290f368d2d9e61ff9b4f428ec/headroom/transforms/__init__.py
- Command line
-
hf download hf://spaces/minhtudragon/headroom_3@cd5ea2ea1d50b68290f368d2d9e61ff9b4f428ec/headroom/transforms/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/minhtudragon/headroom_3/resolve/cd5ea2ea1d50b68290f368d2d9e61ff9b4f428ec/headroom/transforms/__init__.py
3.14 kB
| """Transform modules for Headroom SDK.""" | |
| from .base import Transform | |
| from .cache_aligner import CacheAligner | |
| from .content_detector import ContentType, DetectionResult, detect_content_type | |
| from .intelligent_context import ContextStrategy, IntelligentContextManager | |
| from .log_compressor import LogCompressionResult, LogCompressor, LogCompressorConfig | |
| from .pipeline import TransformPipeline | |
| from .rolling_window import RollingWindow | |
| from .scoring import EmbeddingProvider, MessageScore, MessageScorer | |
| from .search_compressor import ( | |
| SearchCompressionResult, | |
| SearchCompressor, | |
| SearchCompressorConfig, | |
| ) | |
| from .smart_crusher import SmartCrusher, SmartCrusherConfig | |
| from .text_compressor import TextCompressionResult, TextCompressor, TextCompressorConfig | |
| from .tool_crusher import ToolCrusher | |
| # ML-based compression (optional dependency) | |
| try: | |
| from .llmlingua_compressor import ( # noqa: F401 | |
| LLMLinguaCompressor, | |
| LLMLinguaConfig, | |
| LLMLinguaResult, | |
| compress_with_llmlingua, | |
| is_llmlingua_model_loaded, | |
| unload_llmlingua_model, | |
| ) | |
| _LLMLINGUA_AVAILABLE = True | |
| except ImportError: | |
| _LLMLINGUA_AVAILABLE = False | |
| # AST-based code compression (optional dependency) | |
| from .code_compressor import ( | |
| CodeAwareCompressor, | |
| CodeCompressionResult, | |
| CodeCompressorConfig, | |
| CodeLanguage, | |
| DocstringMode, | |
| detect_language, | |
| is_tree_sitter_available, | |
| ) | |
| # Content routing (always available, lazy-loads compressors) | |
| from .content_router import ( | |
| CompressionStrategy, | |
| ContentRouter, | |
| ContentRouterConfig, | |
| RouterCompressionResult, | |
| generate_source_hint, | |
| ) | |
| __all__ = [ | |
| # Base | |
| "Transform", | |
| "TransformPipeline", | |
| # JSON compression | |
| "ToolCrusher", | |
| "SmartCrusher", | |
| "SmartCrusherConfig", | |
| # Text compression (coding tasks) | |
| "ContentType", | |
| "DetectionResult", | |
| "detect_content_type", | |
| "SearchCompressor", | |
| "SearchCompressorConfig", | |
| "SearchCompressionResult", | |
| "LogCompressor", | |
| "LogCompressorConfig", | |
| "LogCompressionResult", | |
| "TextCompressor", | |
| "TextCompressorConfig", | |
| "TextCompressionResult", | |
| # Code-aware compression (AST-based) | |
| "CodeAwareCompressor", | |
| "CodeCompressorConfig", | |
| "CodeCompressionResult", | |
| "CodeLanguage", | |
| "DocstringMode", | |
| "detect_language", | |
| "is_tree_sitter_available", | |
| # Content routing | |
| "ContentRouter", | |
| "ContentRouterConfig", | |
| "RouterCompressionResult", | |
| "CompressionStrategy", | |
| "generate_source_hint", | |
| # Other transforms | |
| "CacheAligner", | |
| "RollingWindow", | |
| # Intelligent context management | |
| "IntelligentContextManager", | |
| "ContextStrategy", | |
| "MessageScorer", | |
| "MessageScore", | |
| "EmbeddingProvider", | |
| # ML-based compression (optional) | |
| "_LLMLINGUA_AVAILABLE", | |
| ] | |
| # Conditionally add LLMLingua exports | |
| if _LLMLINGUA_AVAILABLE: | |
| __all__.extend( | |
| [ | |
| "LLMLinguaCompressor", | |
| "LLMLinguaConfig", | |
| "LLMLinguaResult", | |
| "compress_with_llmlingua", | |
| "is_llmlingua_model_loaded", | |
| "unload_llmlingua_model", | |
| ] | |
| ) | |