Update modeling_codesage.py
Browse files- modeling_codesage.py +3 -1
modeling_codesage.py
CHANGED
@@ -351,7 +351,9 @@ class CodeSageForSequenceClassification(CodeSagePreTrainedModel):
|
|
351 |
|
352 |
self.transformer = CodeSageModel(config)
|
353 |
classifier_dropout = (
|
354 |
-
config.classifier_dropout
|
|
|
|
|
355 |
)
|
356 |
self.dropout = nn.Dropout(classifier_dropout)
|
357 |
self.classifier = nn.Linear(config.hidden_size, config.num_labels)
|
|
|
351 |
|
352 |
self.transformer = CodeSageModel(config)
|
353 |
classifier_dropout = (
|
354 |
+
config.classifier_dropout
|
355 |
+
if hasattr(config, 'classifier_dropout') and config.classifier_dropout is not None
|
356 |
+
else config.residual_dropout_prob
|
357 |
)
|
358 |
self.dropout = nn.Dropout(classifier_dropout)
|
359 |
self.classifier = nn.Linear(config.hidden_size, config.num_labels)
|