llm-guard icon indicating copy to clipboard operation
llm-guard copied to clipboard

llm-guard package installation with poetry.

Open Jurik-001 opened this issue 11 months ago • 14 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?

Jurik-001 avatar Feb 27 '24 15:02 Jurik-001

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?

asofter avatar Feb 28 '24 08:02 asofter

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

Jurik-001 avatar Feb 28 '24 08:02 Jurik-001

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

asofter avatar Feb 28 '24 11:02 asofter

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

Jurik-001 avatar Feb 28 '24 21:02 Jurik-001

Thanks! We do but through pre-commit hooks: https://github.com/protectai/llm-guard/blob/main/.pre-commit-config.yaml#L12-L16

asofter avatar Feb 28 '24 21:02 asofter

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

liadlevy-pando avatar Mar 02 '24 10:03 liadlevy-pando

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

Jurik-001 avatar Mar 02 '24 13:03 Jurik-001

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 avatar Mar 04 '24 08:03 asofter

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

Jurik-001 avatar Mar 05 '24 21:03 Jurik-001

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.

asofter avatar Mar 12 '24 20:03 asofter

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

jayita13 avatar Mar 24 '24 08:03 jayita13

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

jayita13 avatar Mar 24 '24 08:03 jayita13

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.

CandiedCode avatar Apr 29 '24 08:04 CandiedCode

Python 3.12.1 on Windows fails.Issue

from llm_guard import scan_output, scan_prompt ModuleNotFoundError: No module named 'llm_guard'

rahulsingh50 avatar Jul 22 '24 09:07 rahulsingh50