Instructions to use codesage/codesage-small-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use codesage/codesage-small-v2 with Transformers:
# Load model directly from transformers import CodeSage model = CodeSage.from_pretrained("codesage/codesage-small-v2", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Allow for attention weights to be extracted.
#2
by FJFehr - opened
- modeling_codesage.py +1 -1
modeling_codesage.py
CHANGED
|
@@ -149,7 +149,7 @@ class CodeSageBlock(nn.Module):
|
|
| 149 |
feed_forward_hidden_states = self.mlp(hidden_states)
|
| 150 |
hidden_states = residual + feed_forward_hidden_states
|
| 151 |
|
| 152 |
-
outputs = (hidden_states,) + outputs
|
| 153 |
return outputs # hidden_states, present, (attentions)
|
| 154 |
|
| 155 |
|
|
|
|
| 149 |
feed_forward_hidden_states = self.mlp(hidden_states)
|
| 150 |
hidden_states = residual + feed_forward_hidden_states
|
| 151 |
|
| 152 |
+
outputs = (hidden_states,) + outputs
|
| 153 |
return outputs # hidden_states, present, (attentions)
|
| 154 |
|
| 155 |
|