guardrails
guardrails copied to clipboard
[bug] Message: guardrails-cli[6204] , ERROR Failed to inspect
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
Library version: Version (0.4.1)
@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.
@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.
@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: https://github.com/guardrails-ai/guardrails/pull/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!
I was able to replicate this issue in a Windows environment. Going to test the above changes first, then move towards a solution.
facing the same issue
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.
@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.
some fixes
https://github.com/guardrails-ai/competitor_check/pull/3#pullrequestreview-1986563679 https://github.com/guardrails-ai/nsfw_text/pull/1#pullrequestreview-1986564085 https://github.com/guardrails-ai/gibberish_text/pull/1
I managed to fix it by enabling UTF-8 in Windows.
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?
@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.
same issue i am facing in Ubuntu also
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.
This issue was closed because it has been stalled for 14 days with no activity.