Skip to content

Commit

Permalink
[Bug] fix icl eval with nested list (#632)
Browse files Browse the repository at this point in the history
  • Loading branch information
yingfhu committed Nov 24, 2023
1 parent 81b67e8 commit 1884912
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions opencompass/tasks/openicl_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,11 @@ def postprocess(sample):
'The prediction for Self-Consistency'
'must be list.')
if pred_list_flag:
for pred in pred_strs:
pred_strs.append([
self._extract_role_pred(_pred,
role.get('begin', None),
role.get('end', None))
for _pred in pred
])
pred_strs = [[
self._extract_role_pred(_pred, role.get('begin', None),
role.get('end', None))
for _pred in pred
] for pred in pred_strs]
else:
pred_strs = [
self._extract_role_pred(pred, role.get('begin', None),
Expand Down

0 comments on commit 1884912

Please sign in to comment.