Download configuration_bitcache.py from KelvinAxhcar/bitcache-distilgpt2: direct link, hf CLI and curl.
- Browser
- Download file 944 Bytes
-
https://huggingface.co/KelvinAxhcar/bitcache-distilgpt2/resolve/main/configuration_bitcache.py
- Command line
-
hf download hf://KelvinAxhcar/bitcache-distilgpt2/configuration_bitcache.py
-
curl -L -o configuration_bitcache.py https://huggingface.co/KelvinAxhcar/bitcache-distilgpt2/resolve/main/configuration_bitcache.py
944 Bytes
| """ | |
| Configuração do Modelo Hugging Face com Integração BitCache | |
| """ | |
| from transformers import GPT2Config | |
| class BitCacheGPT2Config(GPT2Config): | |
| model_type = "bitcache-gpt2" | |
| def __init__( | |
| self, | |
| retention_ratio: float = 0.35, | |
| profile: str = "cheeger_catalan", | |
| protect_sink: int = 4, | |
| protect_recent: int = 16, | |
| boundary_window: int = 16, | |
| boundary_expansion: int = 6, | |
| **kwargs | |
| ): | |
| super().__init__(**kwargs) | |
| self.retention_ratio = retention_ratio | |
| self.profile = profile | |
| self.protect_sink = protect_sink | |
| self.protect_recent = protect_recent | |
| self.boundary_window = boundary_window | |
| self.boundary_expansion = boundary_expansion | |
| self.auto_map = { | |
| "AutoConfig": "configuration_bitcache.BitCacheGPT2Config", | |
| "AutoModelForCausalLM": "modeling_bitcache.BitCacheGPT2LMHeadModel", | |
| } | |