FlagEmbedding icon indicating copy to clipboard operation
FlagEmbedding copied to clipboard

微调bge-reranker-v2-minicpm-layerwise,添加教师分数脚本用的compute score是不是应该跟推理原生模型时一样?

Open zhangying950 opened this issue 10 months ago • 1 comments

加载Reranker模型

loaded_reranker_model = LayerWiseFlagLLMReranker( 'path_to_original_bge-reranker-v2-minicpm-layerwise', model_class='decoder-only-layerwise', query_max_length=256, passage_max_length=1024, use_fp16=True, devices=['cuda:1'] )

推理: scores = compute_score(pairs, cutoff_layers=[28],normalize=True)

添加教师分数: scores = compute_score(pairs, cutoff_layers=[28])

这样得到的教师分数可以用于finetune吗?cutoff_layers、normalize是需要的吗?

zhangying950 avatar Feb 11 '25 02:02 zhangying950

可以用scores = compute_score(pairs, cutoff_layers=[28])获得教师分数,normalize是不需要的,cutoff_layers视情况而定

545999961 avatar Feb 20 '25 09:02 545999961