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

[bug] Message: guardrails-cli[6204] , ERROR Failed to inspect #648

Closed
musharaf-iqeqdigital opened this issue Mar 15, 2024 · 14 comments
Closed
Labels
bug Something isn't working Stale

Comments

@musharaf-iqeqdigital
Copy link

Describe the bug
I successfully installed Guardrails version 0.4.1 using the following command:
pip install "git+https://github.com/guardrails-ai/guardrails.git@main"

After configuring Guardrails, I attempted to install Guard PII with the following command:

guardrails hub install hub://guardrails/detect_pii
However, I encountered the following error:

UnicodeEncodeError: 'charmap' codec can't encode character '\u2192' in position 3463: character maps to

Additionally, the Guardrails CLI reported:

guardrails-cli[6204] ERROR Failed to inspect

To Reproduce
Steps to reproduce the behavior:
1- Install the guardrails <pip install "git+https://github.com/guardrails-ai/guardrails.git@main">
2- configure guardrails
3- Install Detect PII <guardrails hub install hub://guardrails/detect_pii>

Library version:
Version (0.4.1)

@CalebCourier
Copy link
Collaborator

@musharaf-iqeqdigital Thanks for raising this issue! We're still investigating, but from what we can tell, this is a Windows specific encoding issue. We're working on a fix and will update here once we have something.

@musharaf-iqeqdigital
Copy link
Author

@CalebCourier Thanks for your response! We're currently using Guardrails for a proof of concept (POC) and are keen to continue. Understanding that the issue may be Windows-specific, we appreciate any updates on the fix. Your assistance is invaluable to us in moving forward with our evaluation.

@CalebCourier
Copy link
Collaborator

@musharaf-iqeqdigital I'm still trying to replicate this issue, but in the meantime I do have a work-in-progress branch where any changes for this issue will go. You can see those changes here: #657

If you want to test out these changes as they're still under development you can install from this branch via pip install "git+https://github.com/guardrails-ai/guardrails.git@xplat-encoding"

I'll update here when I have any new findings. Thanks for your again patience!

@CalebCourier
Copy link
Collaborator

I was able to replicate this issue in a Windows environment. Going to test the above changes first, then move towards a solution.

@RoshniRM
Copy link

facing the same issue

@vivek-athina
Copy link

I had encountered part of this error guardrails-cli[6204] ERROR Failed to inspect and it was fixed by upgrading pip to the latest version (Infact any version > 22.2 should fix it).
@musharaf-iqeqdigital @RoshniRM Please try this and see if it works.

@CalebCourier
Copy link
Collaborator

@musharaf-iqeqdigital @RoshniRM @vivek-athina We've found the underlying cause of this error when running on Windows. In some of our Validator's README's there is a character where it should be ->. The character-set that python uses internally on Windows does not have a mapping for this character hence the error. We're going through and updating the Validator README's to correct this. The RegexMatch and DetectPII validators have already been updated and we will continue to roll out updates to any validators with this issue.

@zsimjee
Copy link
Collaborator

zsimjee commented Apr 8, 2024

@nicucalcea
Copy link

I managed to fix it by enabling UTF-8 in Windows.

@mdhuzaifapatel
Copy link

guardrails hub install hub://guardrails/detect_pi

I'm facing the same error for this Validator - guardrails hub install hub://guardrails/toxic_language
How should I fix it?

@CalebCourier
Copy link
Collaborator

@mdhuzaifapatel We are working on updates on our side to mitigate this issue across all validators.

In the meantime, you can work around this issue by enabling UTF-8 like @nicucalcea suggests.

@ashwinimiri
Copy link

same issue i am facing in Ubuntu also

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the Stale label Aug 22, 2024
Copy link

github-actions bot commented Sep 5, 2024

This issue was closed because it has been stalled for 14 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

8 participants