miyuki2026 commited on
Commit
d70ebc4
·
1 Parent(s): ec247a4
examples/tutorials/dpo/ultrachat/step_2_train_sft_model_deepspeed.py CHANGED
@@ -130,6 +130,11 @@ def filter_func(example, tokenizer, response_template):
130
  input_ids = example["input_ids"]
131
  text = tokenizer.decode(input_ids, skip_special_tokens=False)
132
 
 
 
 
 
 
133
  if text.__contains__(response_template):
134
  result = True
135
  else:
 
130
  input_ids = example["input_ids"]
131
  text = tokenizer.decode(input_ids, skip_special_tokens=False)
132
 
133
+ max_length = 1024 if debug_mode else 4096,
134
+ length = len(input_ids)
135
+ if length > max_length:
136
+ raise AssertionError()
137
+
138
  if text.__contains__(response_template):
139
  result = True
140
  else: