protectai / llm-guard

The Security Toolkit for LLM Interactions

Home Page:https://llm-guard.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

llm-guard package installation with poetry.

Jurik-001 opened this issue · comments

If i want to install the llm-guard i run always in following issue:

ModuleNotFoundError: No module named 'torch'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

You address that already in your docs, the problem with your solution is, i did not find a way to integrate it with poetry. Can you please fix it?

Hey @Jurik-001 , we are planning to migrate it to Poetry, but unfortunately, there is no ETA on that. Are you running from Mac M1 since we usually see this problem on ARM-based machines?

Yes thats correct i use an M1 device, i can also support on migrating to poetry, if you want @asofter

That would be great. I have only limited experience with Poetry (as a user but never created a project with it). Thank you!

okay, i am start working on it, i saw you also not configure black, is that right? @asofter

I have this problem as well using pip on MacOs Apple M1 Max @asofter

yeah, i worked yesterday on the switch to poetry, but get trouble with xformers package, same issue if i want install the current guard package, needs some intervention their, whats actually wrong @liadlevy-pando

Do you think it's solved with the newer version of Pytorch? We can try testing using it. Or, I am actually planning to just rely on the ONNX Runtime to remove some dependencies

@asofter so i think the problem is xFormers, if i understand correct that library i based on CUDA (facebookresearch/xformers#987), which clearly not work on mac m chips. In which context you use that lib?

Honestly, we used it somewhere but I don't think we do anymore. Removed the package. Please let me know if it fixed the problem.

I'm facing the same issue with Python 3.12.1 on Windows fails at xformers installation
Any way to resolve it yet @asofter @Jurik-001

seems like Python 3.12 wasn't compatible
I was able to run it with 3.10

Now that python has standardized on several build improvements like PEP 517 and PEP 660, I'm curious what migrating to poetry specifically solves?

Hatch is a PyPA project that seems to support similar functionality as poetry.

rye the makers of ruff and uv, also have a ackage management solution for Python. Because of the monorepo support, it maybe an interesting choice, for managing llm-guard and llm-guard-api.

I use setuptools + pip-tools personally, as I find I have less IDE configuration issues versus using poetry + vscode together.