Download configuration_modern_llm.py from devoppro/FastLLM-MoE-seed: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/devoppro/FastLLM-MoE-seed/resolve/main/configuration_modern_llm.py
- Command line
-
hf download hf://devoppro/FastLLM-MoE-seed/configuration_modern_llm.py
-
curl -L -o configuration_modern_llm.py https://huggingface.co/devoppro/FastLLM-MoE-seed/resolve/main/configuration_modern_llm.py
1.24 kB
| from transformers import PretrainedConfig | |
| QWEN_TOKEN_ID = 151643 | |
| AUTO_MAP = { | |
| "AutoConfig": "configuration_modern_llm.ModernLLMConfig", | |
| "AutoModelForCausalLM": "modeling_modern_llm.ModernLLMForCausalLM", | |
| } | |
| class ModernLLMConfig(PretrainedConfig): | |
| model_type = "modern_llm" | |
| def __init__(self, vocab_size=151936, hidden_size=768, intermediate_size=2048, | |
| num_hidden_layers=12, num_attention_heads=12, num_key_value_heads=4, | |
| max_position_embeddings=2048, rms_norm_eps=1e-6, rope_theta=1000000.0, | |
| pad_token_id=QWEN_TOKEN_ID, bos_token_id=QWEN_TOKEN_ID, eos_token_id=QWEN_TOKEN_ID, **kwargs): | |
| self.vocab_size = vocab_size | |
| self.hidden_size = hidden_size | |
| self.intermediate_size = intermediate_size | |
| self.num_hidden_layers = num_hidden_layers | |
| self.num_attention_heads = num_attention_heads | |
| self.num_key_value_heads = num_key_value_heads | |
| self.max_position_embeddings = max_position_embeddings | |
| self.rms_norm_eps = rms_norm_eps | |
| self.rope_theta = rope_theta | |
| self.auto_map = dict(AUTO_MAP) | |
| super().__init__(pad_token_id=pad_token_id, bos_token_id=bos_token_id, eos_token_id=eos_token_id, **kwargs) | |