-
Notifications
You must be signed in to change notification settings - Fork 429
Description
I am trying to use guard rails in my LLM project and I keep seeing the below error:
ImportError: cannot import name 'ToxicLanguage' from 'guardrails.hub'.
After failing to get this to work, I tried to see if I can get the toxic_language validator to work in a standalone code file as mentioned in the documentation(below). Copy pasted the code. Followed the install instructions to the word and no luck.
https://hub.guardrailsai.com/validator/guardrails/toxic_language
Is the documentation up to date ? I am using VS code, Python 3.11.8 on mac.
When I install toxiclanguage, it says:
There is a newer version of Guardrails available 0.6.6. Your current version is 0.6.5!
Installing hub://guardrails/toxic_language...
[ ==] Running post-install setup/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/huggingface_hub/file_download.py:896: FutureWarning: resume_download
is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use force_download=True
.
warnings.warn(
✅Successfully installed guardrails/toxic_language version 0.0.2!
Here's the pip list:
Package Version
accelerate 0.24.1
aiohappyeyeballs 2.6.1
aiohttp 3.11.18
aiosignal 1.3.2
alembic 1.15.2
annotated-types 0.7.0
anyio 4.9.0
arrow 1.3.0
attrs 25.3.0
blinker 1.9.0
certifi 2025.4.26
charset-normalizer 3.4.1
click 8.1.8
cloudpickle 3.1.1
colorama 0.4.6
contourpy 1.3.2
cycler 0.12.1
datasets 2.17.1
Deprecated 1.2.18
detoxify 0.5.2
diff-match-patch 20230430
dill 0.3.8
distro 1.9.0
docker 7.1.0
entrypoints 0.4
Faker 25.9.2
filelock 3.18.0
Flask 3.1.0
fonttools 4.57.0
fqdn 1.5.1
frozenlist 1.6.0
fsspec 2023.10.0
gitdb 4.0.12
GitPython 3.1.44
googleapis-common-protos 1.70.0
graphene 3.4.3
graphql-core 3.2.6
graphql-relay 3.2.0
greenlet 3.2.1
griffe 0.36.9
grpcio 1.71.0
guardrails-ai 0.6.6
guardrails-api-client 0.4.0a1
guardrails_hub_types 0.0.4
gunicorn 21.2.0
h11 0.16.0
httpcore 1.0.9
httpx 0.28.1
huggingface-hub 0.30.2
idna 3.10
importlib_metadata 7.2.1
isoduration 20.11.0
itsdangerous 2.2.0
Jinja2 3.1.6
jiter 0.9.0
joblib 1.4.2
jsonpatch 1.33
jsonpointer 3.0.0
jsonref 1.1.0
jsonschema 4.23.0
jsonschema-specifications 2025.4.1
kiwisolver 1.4.8
langchain-core 0.3.56
langsmith 0.3.39
litellm 1.67.5
lxml 4.9.4
Mako 1.3.10
Markdown 3.8
markdown-it-py 3.0.0
MarkupSafe 3.0.2
matplotlib 3.10.1
mdurl 0.1.2
mlflow 2.12.1
mpmath 1.3.0
multidict 6.4.3
multiprocess 0.70.16
networkx 3.4.2
nltk 3.9.1
numpy 1.26.4
openai 1.76.2
opentelemetry-api 1.32.1
opentelemetry-exporter-otlp-proto-common 1.32.1
opentelemetry-exporter-otlp-proto-grpc 1.32.1
opentelemetry-exporter-otlp-proto-http 1.32.1
opentelemetry-proto 1.32.1
opentelemetry-sdk 1.32.1
opentelemetry-semantic-conventions 0.53b1
orjson 3.10.18
packaging 24.2
pandas 2.2.3
peft 0.7.1
pillow 11.2.1
pip 24.0
propcache 0.3.1
protobuf 5.29.4
psutil 7.0.0
pyarrow 15.0.2
pyarrow-hotfix 0.7
pydantic 2.11.4
pydantic_core 2.33.2
pydash 7.0.7
Pygments 2.19.1
PyJWT 2.10.1
pyparsing 3.2.3
python-dateutil 2.9.0.post0
python-dotenv 1.1.0
pytz 2024.2
PyYAML 6.0.2
querystring-parser 1.2.4
referencing 0.36.2
regex 2024.11.6
requests 2.32.3
requests-toolbelt 1.0.0
rfc3339-validator 0.1.4
rfc3986-validator 0.1.1
rich 13.9.4
rpds-py 0.24.0
rstr 3.2.2
safetensors 0.5.3
scikit-learn 1.6.1
scipy 1.15.2
semver 3.0.4
sentence-transformers 2.3.1
sentencepiece 0.2.0
setuptools 65.5.0
shellingham 1.5.4
six 1.17.0
smmap 5.0.2
sniffio 1.3.1
SQLAlchemy 2.0.40
sqlparse 0.5.3
sympy 1.14.0
tenacity 9.1.2
threadpoolctl 3.6.0
tiktoken 0.9.0
tokenizers 0.15.2
torch 2.1.2
tqdm 4.67.1
transformers 4.36.2
typer 0.15.3
types-python-dateutil 2.9.0.20241206
typing_extensions 4.13.2
typing-inspection 0.4.0
tzdata 2025.2
uri-template 1.3.0
urllib3 2.0.7
webcolors 24.11.1
Werkzeug 3.1.3
wrapt 1.17.2
xxhash 3.5.0
yarl 1.20.0
zipp 3.21.0
zstandard 0.23.0