Skip to content

Commit

Permalink
fix bug in generate_qa_from_example_mapper (#517)
Browse files Browse the repository at this point in the history
* fix format bug

* fix test
  • Loading branch information
BeachWang authored Dec 26, 2024
1 parent 0125e1f commit 36af193
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions data_juicer/ops/mapper/generate_qa_from_examples_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ def format_qa_pairs(qa_example):
])

formatted_examples = ''.join([
self.example_template.format(qa_pairs=format_qa_pairs(qa_example))
self.example_template.format(format_qa_pairs(qa_example))
for qa_example in qa_examples
])
input_prompt = self.input_template.format(examples=formatted_examples)
input_prompt = self.input_template.format(formatted_examples)
return input_prompt

def parse_output(self, raw_output):
Expand Down
2 changes: 1 addition & 1 deletion tests/ops/mapper/test_generate_qa_from_examples_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test(self):

def test_multi_process(self):
sampling_params = {'max_new_tokens': 200}
self._run_op(sampling_params=sampling_params, num_proc=3)
self._run_op(sampling_params=sampling_params, num_proc=2)

def test_vllm(self):
sampling_params = {'max_tokens': 200}
Expand Down

0 comments on commit 36af193

Please sign in to comment.