Upload ModularStarEncoder
Browse files- modularStarEncoder.py +2 -2
modularStarEncoder.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
from transformers import AutoConfig, Starcoder2Model, Starcoder2Config
|
2 |
import sys
|
3 |
import os
|
4 |
-
from
|
5 |
import math
|
6 |
import os
|
7 |
import warnings
|
@@ -155,7 +155,7 @@ class StarEncoder2LMPredictionHead(nn.Module):
|
|
155 |
for element in dir(config):
|
156 |
value = getattr(config, element) # Get the attribute value
|
157 |
if isinstance(value, tuple) or isinstance(value, list):
|
158 |
-
setattr(config, element, value[
|
159 |
self.transform = StarEncoder2PredictionHeadTransform(config)
|
160 |
|
161 |
# The output weights are the same as the input embeddings, but there is
|
|
|
1 |
from transformers import AutoConfig, Starcoder2Model, Starcoder2Config
|
2 |
import sys
|
3 |
import os
|
4 |
+
from config import ModularStarEncoderConfig
|
5 |
import math
|
6 |
import os
|
7 |
import warnings
|
|
|
155 |
for element in dir(config):
|
156 |
value = getattr(config, element) # Get the attribute value
|
157 |
if isinstance(value, tuple) or isinstance(value, list):
|
158 |
+
setattr(config, element, value[-1])
|
159 |
self.transform = StarEncoder2PredictionHeadTransform(config)
|
160 |
|
161 |
# The output weights are the same as the input embeddings, but there is
|