Transformers
PyTorch
code
custom_code
Inference Endpoints
codesage commited on
Commit
d4c8b2d
1 Parent(s): 542998f

Update modeling_codesage.py

Browse files
Files changed (1) hide show
  1. 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 if config.classifier_dropout is not None else config.residual_dropout_prob
 
 
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)