ydshieh
commited on
Commit
·
981428d
1
Parent(s):
75b4b63
add config
Browse files- config.json +7 -0
- configuration_my_model.py +13 -0
config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"n_layers": 2,
|
| 3 |
+
"model_type": "my_model",
|
| 4 |
+
"auto_map": {
|
| 5 |
+
"AutoConfig": "configuration_my_model.MyModelConfig"
|
| 6 |
+
}
|
| 7 |
+
}
|
configuration_my_model.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import PretrainedConfig
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
class MyModelConfig(PretrainedConfig):
|
| 5 |
+
model_type = "my_model"
|
| 6 |
+
|
| 7 |
+
def __init__(
|
| 8 |
+
self,
|
| 9 |
+
n_layers=2,
|
| 10 |
+
**kwargs,
|
| 11 |
+
):
|
| 12 |
+
self.n_layers = n_layers
|
| 13 |
+
super().__init__(**kwargs)
|