Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jintao-Huang committed Dec 26, 2024
1 parent 9b75b48 commit d2c88d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion swift/llm/template/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ def _kto_encode(self, inputs: StdTemplateInputs) -> Dict[str, Any]:

def _seq_cls_encode(self, inputs: StdTemplateInputs) -> Dict[str, Any]:
encoded = self._encode(inputs)
encoded['labels'] = int(inputs.label)
if inputs.label is not None:
encoded['labels'] = int(inputs.label)
return encoded

def encode(self,
Expand Down

0 comments on commit d2c88d1

Please sign in to comment.