Upload model
Browse files- config.json +6 -1
- modeling_mamba.py +1 -5
config.json
CHANGED
@@ -1,6 +1,10 @@
|
|
1 |
{
|
|
|
|
|
|
|
2 |
"auto_map": {
|
3 |
-
"AutoConfig": "configuration_mamba.MambaConfig"
|
|
|
4 |
},
|
5 |
"bias": false,
|
6 |
"conv_bias": true,
|
@@ -14,6 +18,7 @@
|
|
14 |
"model_type": "mamba",
|
15 |
"n_layer": 24,
|
16 |
"pad_vocab_size_multiple": 8,
|
|
|
17 |
"transformers_version": "4.37.2",
|
18 |
"vocab_size": 50280
|
19 |
}
|
|
|
1 |
{
|
2 |
+
"architectures": [
|
3 |
+
"MambaModelForCausalLM"
|
4 |
+
],
|
5 |
"auto_map": {
|
6 |
+
"AutoConfig": "configuration_mamba.MambaConfig",
|
7 |
+
"AutoModelForCausalLM": "modeling_mamba.MambaModelForCausalLM"
|
8 |
},
|
9 |
"bias": false,
|
10 |
"conv_bias": true,
|
|
|
18 |
"model_type": "mamba",
|
19 |
"n_layer": 24,
|
20 |
"pad_vocab_size_multiple": 8,
|
21 |
+
"torch_dtype": "float32",
|
22 |
"transformers_version": "4.37.2",
|
23 |
"vocab_size": 50280
|
24 |
}
|
modeling_mamba.py
CHANGED
@@ -186,7 +186,7 @@ class Mamba(nn.Module):
|
|
186 |
return y
|
187 |
|
188 |
|
189 |
-
class
|
190 |
def __init__(self, config: MambaConfig):
|
191 |
"""A single Mamba block, as described in Figure 3 in Section 3.4 in the Mamba paper [1]."""
|
192 |
super().__init__()
|
@@ -196,10 +196,6 @@ class Block(nn.Module):
|
|
196 |
self.norm = MambaRMSNorm(config.d_model)
|
197 |
|
198 |
|
199 |
-
class MambaBlock(Block):
|
200 |
-
pass
|
201 |
-
|
202 |
-
|
203 |
class MambaPreTrainedModel(PreTrainedModel):
|
204 |
config_class = MambaConfig
|
205 |
base_model_prefix = "backbone"
|
|
|
186 |
return y
|
187 |
|
188 |
|
189 |
+
class MambaBlock(nn.Module):
|
190 |
def __init__(self, config: MambaConfig):
|
191 |
"""A single Mamba block, as described in Figure 3 in Section 3.4 in the Mamba paper [1]."""
|
192 |
super().__init__()
|
|
|
196 |
self.norm = MambaRMSNorm(config.d_model)
|
197 |
|
198 |
|
|
|
|
|
|
|
|
|
199 |
class MambaPreTrainedModel(PreTrainedModel):
|
200 |
config_class = MambaConfig
|
201 |
base_model_prefix = "backbone"
|