Skip to content

Commit 51cafe5

Browse files
authored
support qwen3_self_cognition (#4039)
1 parent 0c2bb7d commit 51cafe5

File tree

1 file changed

+3
-2
lines changed
  • swift/llm/dataset/dataset

1 file changed

+3
-2
lines changed

swift/llm/dataset/dataset/llm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,9 +829,10 @@ def preprocess(self, row: Dict[str, Any]) -> Dict[str, Any]:
829829
return super().preprocess(row)
830830

831831

832-
class ThinkSelfCognitionPreprocessor(SelfCognitionPreprocessor):
832+
class Qwen3SelfCognitionPreprocessor(SelfCognitionPreprocessor):
833833

834834
def preprocess(self, row: Dict[str, Any]) -> Dict[str, Any]:
835+
row['query'] = row['query'] + ' /no_think'
835836
row['response'] = '<think>\n\n</think>\n\n' + row['response']
836837
return super().preprocess(row)
837838

@@ -842,6 +843,6 @@ def preprocess(self, row: Dict[str, Any]) -> Dict[str, Any]:
842843
hf_dataset_id='modelscope/self-cognition',
843844
subsets=[
844845
SubsetDataset(preprocess_func=SelfCognitionPreprocessor()),
845-
SubsetDataset('think', preprocess_func=ThinkSelfCognitionPreprocessor()),
846+
SubsetDataset('qwen3', preprocess_func=Qwen3SelfCognitionPreprocessor()),
846847
],
847848
tags=['chat', 'self-cognition', '🔥']))

0 commit comments

Comments
 (0)