Skip to content

Commit e0eb4b8

Browse files
committed
correct labels
1 parent f8fd440 commit e0eb4b8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

convert_hf_to_gguf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3095,7 +3095,7 @@ def set_gguf_parameters(self):
30953095
if is_rerank:
30963096
self.gguf_writer.add_pooling_type(gguf.PoolingType.RANK)
30973097
self.gguf_writer.add_sep_token_id(self.sep_token_id)
3098-
self.gguf_writer.add_uint32(gguf.Keys.Classifier.OUTPUT_LABELS, 2)
3098+
self.gguf_writer.add_classifier_output_labels(["yes", "no"])
30993099

31003100
def _get_cls_out_tensor(self, data_torch: Tensor) -> Tensor:
31013101
# extract "yes" and "no" tokens from the output lm_head tensor

src/llama-model.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2470,7 +2470,7 @@ bool llama_model::load_tensors(llama_model_loader & ml) {
24702470
tok_embd = create_tensor(tn(LLM_TENSOR_TOKEN_EMBD, "weight"), {n_embd, n_vocab}, 0);
24712471

24722472
// output rerank
2473-
cls_out = create_tensor(tn(LLM_TENSOR_CLS_OUT, "weight"), {n_embd, 2}, TENSOR_NOT_REQUIRED);
2473+
cls_out = create_tensor(tn(LLM_TENSOR_CLS_OUT, "weight"), {n_embd, hparams.n_cls_out}, TENSOR_NOT_REQUIRED);
24742474

24752475
// output
24762476
output_norm = create_tensor(tn(LLM_TENSOR_OUTPUT_NORM, "weight"), {n_embd}, 0);

0 commit comments

Comments
 (0)