Upload model
Browse files- LegibilityModel.py +2 -1
LegibilityModel.py
CHANGED
@@ -18,7 +18,8 @@ class LegibilityModel(PreTrainedModel):
|
|
18 |
nn.Linear(768, 1)
|
19 |
)
|
20 |
|
21 |
-
|
|
|
22 |
output = self.model(img_batch)
|
23 |
# average the output of the last hidden layer
|
24 |
output = output.last_hidden_state.mean(dim=1)
|
|
|
18 |
nn.Linear(768, 1)
|
19 |
)
|
20 |
|
21 |
+
# choice, img0, img1 are not used by the model, but are passed by the trainer
|
22 |
+
def forward(self, img_batch, choice, img0, img1):
|
23 |
output = self.model(img_batch)
|
24 |
# average the output of the last hidden layer
|
25 |
output = output.last_hidden_state.mean(dim=1)
|