JacobLinCool commited on
Commit
5a8a1bf
·
1 Parent(s): 946fdeb

fix: mistral evaluator output format

Browse files
model/mistral_7b_ielts_evaluator.py CHANGED
@@ -58,7 +58,10 @@ def grade_mistral_7b_ielts_evaluator(question: str, answer: str) -> Tuple[float,
58
  ## Evaluation:
59
  """
60
 
61
- outputs = pipe(text, max_length=1024)
62
- overall_score = float(0.0)
 
 
 
63
 
64
- return overall_score, outputs
 
58
  ## Evaluation:
59
  """
60
 
61
+ outputs = pipe(text, max_length=2048)
62
+ comment = outputs[0]["generated_text"].split("## Evaluation:")[1].strip()
63
+ overall_score = float(
64
+ comment.split("Suggested Overall Band Score: ")[1].split("\n")[0] or 0.0
65
+ )
66
 
67
+ return overall_score, comment