drizzlezyk commited on
Commit
e19cb2e
·
verified ·
1 Parent(s): 6291b0d

Upload inference/configuration_openpangu_dense.py with huggingface_hub

Browse files
inference/configuration_openpangu_dense.py ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved.
3
+ # Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
4
+ #
5
+ # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
6
+ # and OPT implementations in this library. It has been modified from its
7
+ # original forms to accommodate minor architectural differences compared
8
+ # to GPT-NeoX and OPT used by the Meta AI team that trained the model.
9
+ #
10
+ # Licensed under the Apache License, Version 2.0 (the "License");
11
+ # you may not use this file except in compliance with the License.
12
+ # You may obtain a copy of the License at
13
+ #
14
+ # http://www.apache.org/licenses/LICENSE-2.0
15
+ #
16
+ # Unless required by applicable law or agreed to in writing, software
17
+ # distributed under the License is distributed on an "AS IS" BASIS,
18
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ # See the License for the specific language governing permissions and
20
+ # limitations under the License.
21
+
22
+ from transformers.utils import logging
23
+ from transformers.configuration_utils import PretrainedConfig
24
+
25
+
26
+ logger = logging.get_logger(__name__)
27
+
28
+
29
+ class PanguEmbeddedConfig(PretrainedConfig):
30
+
31
+ model_type = "PanguEmbedded"
32
+ _auto_class = "AutoConfig"
33
+
34
+ def __init__(
35
+ self,
36
+ vocab_size=153376,
37
+ hidden_size=4096,
38
+ intermediate_size=12800,
39
+ num_hidden_layers=34,
40
+ num_attention_heads=32,
41
+ num_key_value_heads=8,
42
+ hidden_act="silu",
43
+ max_position_embeddings=32768,
44
+ initializer_range=0.02,
45
+ rms_norm_eps=1e-5,
46
+ use_cache=True,
47
+ pad_token_id=0,
48
+ bos_token_id=1,
49
+ eos_token_id=45892,
50
+ tie_word_embeddings=False,
51
+ rope_theta=16000000.0,
52
+ bias=True,
53
+ **kwargs,
54
+ ):
55
+ self.vocab_size = vocab_size
56
+ self.max_position_embeddings = max_position_embeddings
57
+ self.hidden_size = hidden_size
58
+ self.intermediate_size = intermediate_size
59
+ self.num_hidden_layers = num_hidden_layers
60
+ self.num_attention_heads = num_attention_heads
61
+ self.num_key_value_heads = num_key_value_heads
62
+ self.hidden_act = hidden_act
63
+ self.initializer_range = initializer_range
64
+ self.rms_norm_eps = rms_norm_eps
65
+ self.use_cache = use_cache
66
+ self.rope_theta = rope_theta
67
+ self.bias = bias
68
+ super().__init__(
69
+ pad_token_id=pad_token_id,
70
+ bos_token_id=bos_token_id,
71
+ eos_token_id=eos_token_id,
72
+ tie_word_embeddings=tie_word_embeddings,
73
+ **kwargs,
74
+ )