Skip to content

Fix issue #71#72

Merged
yisz merged 1 commit intorelari-ai:mainfrom
kelvinchanwh:patch-1
Jun 11, 2024
Merged

Fix issue #71#72
yisz merged 1 commit intorelari-ai:mainfrom
kelvinchanwh:patch-1

Conversation

@kelvinchanwh
Copy link
Contributor

@kelvinchanwh kelvinchanwh commented Jun 11, 2024

Fixed issue #71 where responses that cannot be split fails


🚀 This description was created by Ellipsis for commit 6809468

Summary:

Fixes a response handling error in LLMBasedFaithfulness by updating the exception handling to process the entire response if it cannot be split.

Key points:

  • Fixed ValueError in LLMBasedFaithfulness class when response splitting fails
  • Updated error handling to check for 'yes' in the entire response and use it as reasoning if splitting fails
  • Modified in continuous_eval/metrics/generation/text/llm_based.py

Generated with ❤️ by ellipsis.dev

Fixed issue where responses that cannot be split fails
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Reviewed everything up to 6809468 in 1 minute and 17 seconds

More details
  • Looked at 14 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_d2sRnvEeJc2MECjN


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

score = float("yes" in score_txt.lower())
except ValueError:
score = float("yes" in score_txt.lower())
score = float("yes" in response.lower())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conversion of the boolean expression to a float is incorrect. It should be converted to an integer since the score is expected to be either 0 or 1 based on the presence of 'yes'.

Suggested change
score = float("yes" in response.lower())
score = int('yes' in response.lower())

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not correct - we want float in this case.

@yisz
Copy link
Contributor

yisz commented Jun 11, 2024

@kelvinchanwh Thanks for the quick fixes!

@yisz yisz merged commit dba8fb8 into relari-ai:main Jun 11, 2024
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

Successfully merging this pull request may close these issues.

2 participants