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

Fix for MacOS users encountering model load errors #6227

Merged
merged 61 commits into from
Jul 13, 2024

Conversation

InvectorGator
Copy link
Contributor

Fix for the following error when attempting to load any model on a Mac:
"The CPU version of llama-cpp-python is already loaded. Switching to the default version currently requires a server restart."

Checklist:

oobabooga and others added 22 commits March 7, 2024 13:13
@oobabooga
Copy link
Owner

I changed the implementation to a simpler and more streamlined one with the same logic on macos. Let me know if it doesn't work.

@oobabooga oobabooga merged commit 4148a92 into oobabooga:dev Jul 13, 2024
@SomeOddCodeGuy
Copy link

I changed the implementation to a simpler and more streamlined one with the same logic on macos. Let me know if it doesn't work.

I gave your alternative fix a quick try and it worked on my Mac. So Mac users should be good with this.

However, I can't determine if it will work for AMD users on Linux, as one of the users who was affected by this issue on the other thread fit that category.

For example, when I remove the macos specific check, I hit:

Exception: Cannot import llama_cpp_cuda because llama_cpp is already imported. Switching to a different version of llama-cpp-python currently requires a server restart.

I'm concerned an AMD/Linux user might hit that check as well.

@oobabooga
Copy link
Owner

Thanks for the confirmation.

I'm concerned an AMD/Linux user might hit that check as well.

It should work. Both AMD and CUDA have llama_cpp_cuda as the main library, and it gets imported by default. The llama_cpp import afterwards is a fallback in case the user wants to uninstall the provided libraries and compile a custom llama-cpp-python version.

PoetOnTheRun pushed a commit to PoetOnTheRun/text-generation-webui that referenced this pull request Oct 22, 2024

---------

Co-authored-by: oobabooga <[email protected]>
Co-authored-by: Invectorgator <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants