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

CompetitorCheck drops whitespace between sentences #23

Open
CalebCourier opened this issue Nov 21, 2024 · 1 comment
Open

CompetitorCheck drops whitespace between sentences #23

CalebCourier opened this issue Nov 21, 2024 · 1 comment
Assignees

Comments

@CalebCourier
Copy link
Contributor

NOTE: This is with remote inference. I haven't tried with the local model.

from guardrails.hub import CompetitorCheck

v = CompetitorCheck(
    competitors=["Fortran", "Ada", "Pascal"],
    on_fail="fix"
)

response = v.validate("The author is Paul Graham. Growing up, he worked on writing short stories and programming, starting with the IBM 1401 in 9th grade using an early version of Fortran. Later, he transitioned to microcomputers like the TRS-80 and began programming more extensively, creating simple games and a word processor.", {})

print(response.fix_value)
The author is Paul Graham.Growing up, he worked on writing short stories and programming, starting with the IBM 1401 in 9th grade using an early version of [COMPETITOR].Later, he transitioned to microcomputers like the TRS-80 and began programming more extensively, creating simple games and a word processor.
@JosephCatrambone
Copy link
Contributor

Fixing in my next PR.

@JosephCatrambone JosephCatrambone self-assigned this Dec 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

No branches or pull requests

2 participants