add notes:
Browse files- modeling.py +4 -2
modeling.py
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
import torch
|
2 |
-
from transformers import
|
3 |
|
4 |
from .configuration import NewModelConfig
|
5 |
|
6 |
-
class
|
|
|
|
|
7 |
config_class = NewModelConfig
|
8 |
|
9 |
def __init__(self, config):
|
|
|
1 |
import torch
|
2 |
+
from transformers import BertModel
|
3 |
|
4 |
from .configuration import NewModelConfig
|
5 |
|
6 |
+
# It doesn't inherit from a generate-compatible class, so it would throw an error when calling `generate` if
|
7 |
+
# `transformers` wouldn't automatically patch inheritance
|
8 |
+
class NewModelForCausalLM(BertModel):
|
9 |
config_class = NewModelConfig
|
10 |
|
11 |
def __init__(self, config):
|