ChenyuRabbitLove commited on
Commit
52dc17f
1 Parent(s): ca1e893

bugfix: fix minor bugs

Browse files
Files changed (1) hide show
  1. utils/completion_reward.py +4 -4
utils/completion_reward.py CHANGED
@@ -425,10 +425,10 @@ class MTKAgent:
425
  ).json()
426
  response_text = response["choices"][0]["message"]["content"]
427
 
428
- matched_content = re.search("```(.+)", response_text, re.DOTALL)
429
- extracted_content = (
430
- matched_content.group(1).strip() if matched_content else None
431
- )
432
 
433
  chinese_converter = OpenCC("s2tw")
434
 
 
425
  ).json()
426
  response_text = response["choices"][0]["message"]["content"]
427
 
428
+ matched_contents = re.findall("```(.*?)```", response_text, re.DOTALL)
429
+
430
+ # Concatenate all extracted contents
431
+ extracted_content = "\n".join(matched_contents).strip()
432
 
433
  chinese_converter = OpenCC("s2tw")
434