Skip to content

Commit e194845

Browse files
committed
update reranker FT
1 parent ab2ea54 commit e194845

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

FlagEmbedding/abc/finetune/reranker/AbsModeling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def forward(self, pair: Union[Dict[str, Tensor], List[Dict[str, Tensor]]] = None
6161
if teacher_scores is not None:
6262
teacher_targets = teacher_targets.to(grouped_logits.device)
6363
# print(teacher_targets, torch.mean(torch.sum(torch.log_softmax(grouped_logits, dim=-1) * teacher_targets, dim=-1)))
64-
loss += torch.mean(torch.sum(torch.log_softmax(grouped_logits, dim=-1) * teacher_targets, dim=-1))
64+
loss += - torch.mean(torch.sum(torch.log_softmax(grouped_logits, dim=-1) * teacher_targets, dim=-1))
6565
else:
6666
loss = None
6767

examples/finetune/reranker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ torchrun --nproc_per_node 2 \
248248
--query_instruction_format '{}{}' \
249249
--passage_instruction_for_rerank 'B: ' \
250250
--passage_instruction_format '{}{}' \
251-
--output_dir ./test_decoder_only_base_bge-reranker-v2-gemma \
251+
--output_dir ./test_decoder_only_base_bge-reranker-v2-minicpm-layerwise \
252252
--overwrite_output_dir \
253253
--learning_rate 2e-4 \
254254
--fp16 \

0 commit comments

Comments
 (0)