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] ImportError and OSError: [E050] #1148

Open
Iris-Liuu opened this issue Oct 28, 2024 · 4 comments
Open

[bug] ImportError and OSError: [E050] #1148

Iris-Liuu opened this issue Oct 28, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Iris-Liuu
Copy link

i've been stuck with these error when i'm trying to run the example code i found form the guardrails-ai website and github.

i followed the instruction on https://www.guardrailsai.com/docs/getting_started/quickstart, which i pip install guardrails-ai and guardrails configure, then everytime when i try to run "from guardrails.hub import ProfanityFree" i got this error :
ImportError: cannot import name 'ProfanityFree' from 'guardrails.hub' (/usr/local/lib/python3.10/dist-packages/guardrails/hub/init.py)
i've tried many ways to deal with it, such as !python -m spacy download en_core_web_sm or viewing the Guardrails hub downlaod path and the files within the package, but none of them works.

the OSError seem to be related to the previous error, i encounter this freuqently when i'm installing thing related to Dbias :
OSError: [E050] Can't find model 'en_pipeline'. It doesn't seem to be a Python package or a valid path to a data directory
i've try install the missing packages chatgpt suggested me, but still stuck here

i'm coding in google colab by the way

it'll be realy helpful if someone can provide a comperhensive code for installing and runing guardrail-ai validator
any comments and suggestions will be appreciated.

@Iris-Liuu Iris-Liuu added the bug Something isn't working label Oct 28, 2024
@dtam
Copy link
Contributor

dtam commented Oct 28, 2024

hi could you try guardrails hub uninstall hub://guardrails/profanity_free it looks like there might have been an error with its installation and its blocking the initialization of the rest of the library

@dtam dtam self-assigned this Oct 28, 2024
@AlejandroEsquivel
Copy link
Contributor

Hi @Iris-Liuu as for:

the OSError seem to be related to the previous error, i encounter this freuqently when i'm installing thing related to Dbias :
OSError: [E050] Can't find model 'en_pipeline'.

The following might work:
pip install https://huggingface.co/d4data/en_pipeline/resolve/main/en_pipeline-any-py3-none-any.whl

@JosephCatrambone
Copy link
Contributor

This validator might need a bit of a rewrite to bring it into the current year. The models still appear to be public, though.

@Iris-Liuu
Copy link
Author

@dtam it works(solve the previous import error), thanks a lot

@AlejandroEsquivel i tried install it by pip install and download it then install with path, but both way encounterd the below error
ERROR: Invalid requirement: 'en-pipeline==any': Expected end or semicolon (after name and no valid version specifier) en-pipeline==any

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants