Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLMBasedFaithfulness fails when response cannot be split into score and reasoning #71

Open
kelvinchanwh opened this issue Jun 11, 2024 · 0 comments

Comments

@kelvinchanwh
Copy link
Contributor

In continuous_eval/metrics/generation/text/llm_based.py line 72-77, the response is split into a score and reasoning. If the split fails, the score in line 76 should check if "yes" is in response.lower() rather than score_txt.lower() since score_txt has not been defined yet.

AS-IS:

try:
    score_txt, reasoning = response.split("\n", 1)
    score = float("yes" in score_txt.lower())
except ValueError:
    score = float("yes" in score_txt.lower())
    reasoning = response

TO-BE:

  try:
      score_txt, reasoning = response.split("\n", 1)
      score = float("yes" in score_txt.lower())
  except ValueError:
      score = float("yes" in response.lower())
      reasoning = response
kelvinchanwh added a commit to kelvinchanwh/continuous-eval that referenced this issue Jun 11, 2024
Fixed issue where responses that cannot be split fails
yisz pushed a commit that referenced this issue Jun 11, 2024
Fixed issue where responses that cannot be split fails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant