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

Vector similarity score comparison #109

Open
jsarneja opened this issue Feb 2, 2024 · 0 comments
Open

Vector similarity score comparison #109

jsarneja opened this issue Feb 2, 2024 · 0 comments

Comments

@jsarneja
Copy link

jsarneja commented Feb 2, 2024

According to the script detect_pi_vectorbase.py in python-sdk/rebuff/, the below code snippet assumes higher similarity score implies prompt injection, whereas it seems it should be the opposite i.e. a lower similarity score should mean prompt injection? The same logic is then used in detect_injection method in sdk.py to declare if injection exists.

Also the first if condition equates score and top_score and therefore second if condition would never run?

Am I missing something here?

snipped from detect_pi_vectorbase.py
image

snipped from sdk.py
image

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