mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00
[Fix] triviaqa & nq postprocess (#350)
This commit is contained in:
parent
ce65d3393b
commit
a1782f9a08
@ -44,7 +44,7 @@ class NQEvaluator(BaseEvaluator):
|
||||
}
|
||||
processed_predictions = []
|
||||
for prediction in predictions:
|
||||
prediction = prediction.split('\n')[0].lower()
|
||||
prediction = prediction.strip().split('\n')[0].lower()
|
||||
if 'answer is' in prediction:
|
||||
prediction = prediction.split('answer is')[-1]
|
||||
prediction = general_postprocess(prediction)
|
||||
|
@ -43,7 +43,7 @@ class TriviaQAEvaluator(BaseEvaluator):
|
||||
}
|
||||
processed_predictions = []
|
||||
for prediction in predictions:
|
||||
prediction = prediction.split('\n')[0].lower()
|
||||
prediction = prediction.strip().split('\n')[0].lower()
|
||||
if 'answer is' in prediction:
|
||||
prediction = prediction.split('answer is')[-1]
|
||||
prediction = general_postprocess(prediction)
|
||||
|
Loading…
Reference in New Issue
Block a user