Closed ashish-aesthisia closed 1 week ago
Could you explain how the change in this PR is doing anything different from what the requirements.txt did before? You seem to do the same checks for system and python version and are selecting the same wheels in case they match. The main change is that the requirements.txt file installed both versions of llama-cpp before (cpu and cuda) and with this PR only one of them would be installed.
It's perfectly fine for both packages to be installed, I explicitly have code in the node: See code here
try:
Llama = importlib.import_module("llama_cpp_cuda").Llama
except ImportError:
Llama = importlib.import_module("llama_cpp").Llama
that tries to load the cuda version first and only falls back to using the cpu version if that failed.
Could you explain how the change in this PR is doing anything different from what the requirements.txt did before? You seem to do the same checks for system and python version and are selecting the same wheels in case they match. The main change is that the requirements.txt file installed both versions of llama-cpp before (cpu and cuda) and with this PR only one of them would be installed.
It's perfectly fine for both packages to be installed, I explicitly have code in the node: See code here
try: Llama = importlib.import_module("llama_cpp_cuda").Llama except ImportError: Llama = importlib.import_module("llama_cpp").Llama
that tries to load the cuda version first and only falls back to using the cpu version if that failed.
Yes You are right I think, This might be a problem on our end as requirements are not persistent. I installed the node & saw both cpu & gpu llama python. I think we don't need to do this change.
Key problem is that our session doesn't persist the requirements. So Let me once try on our end, this PR might not be needed. Thanks for the clarification.
Key problem is that our session doesn't persist the requirements. So Let me once try on our end, this PR might not be needed. Thanks for the clarification.
OK, that makes sense. And if you don't persist installed packages, you will also see similar problems with all kinds of other comfyui nodes. Let me know if you encounter any more problems.
We have been using this with cuda enabled machine but when installing this node, it always installs llama_cpp_python, which is cpu version.
For us when we changed to llama_cpp_python_cuda, it works faster & LLM models are able to load quickly.
Closes #6 #3
Test: After this changes, it automatically picks up the llama cpp installation based on CPU or GPU availability.
Let me know if any further changes are needed.