Update structformer_as_hf.py
Browse files- structformer_as_hf.py +1 -43
structformer_as_hf.py
CHANGED
|
@@ -1,45 +1,3 @@
|
|
| 1 |
-
Hugging Face's logo
|
| 2 |
-
Hugging Face
|
| 3 |
-
Search models, datasets, users...
|
| 4 |
-
Models
|
| 5 |
-
Datasets
|
| 6 |
-
Spaces
|
| 7 |
-
Docs
|
| 8 |
-
Solutions
|
| 9 |
-
Pricing
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
omarmomen
|
| 15 |
-
/
|
| 16 |
-
structformer_s1_final
|
| 17 |
-
|
| 18 |
-
like
|
| 19 |
-
0
|
| 20 |
-
Fill-Mask
|
| 21 |
-
Transformers
|
| 22 |
-
PyTorch
|
| 23 |
-
structformer
|
| 24 |
-
custom_code
|
| 25 |
-
Model card
|
| 26 |
-
Files and versions
|
| 27 |
-
Community
|
| 28 |
-
Settings
|
| 29 |
-
structformer_s1_final
|
| 30 |
-
/
|
| 31 |
-
structformer_as_hf.py
|
| 32 |
-
Omar
|
| 33 |
-
upfdate
|
| 34 |
-
a7e60f9
|
| 35 |
-
3 months ago
|
| 36 |
-
raw
|
| 37 |
-
history
|
| 38 |
-
blame
|
| 39 |
-
edit
|
| 40 |
-
delete
|
| 41 |
-
No virus
|
| 42 |
-
36.1 kB
|
| 43 |
import torch
|
| 44 |
import torch.nn as nn
|
| 45 |
import torch.nn.functional as F
|
|
@@ -1162,4 +1120,4 @@ class StructformerModelForSequenceClassification(PreTrainedModel):
|
|
| 1162 |
|
| 1163 |
|
| 1164 |
def forward(self, input_ids, labels=None, **kwargs):
|
| 1165 |
-
return self.model(input_ids, labels=labels, **kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import torch
|
| 2 |
import torch.nn as nn
|
| 3 |
import torch.nn.functional as F
|
|
|
|
| 1120 |
|
| 1121 |
|
| 1122 |
def forward(self, input_ids, labels=None, **kwargs):
|
| 1123 |
+
return self.model(input_ids, labels=labels, **kwargs)
|