8000 Fix #891 by kddubey · Pull Request #952 · abetlen/llama-cpp-python · GitHub
[go: up one dir, main page]

Skip to content

Fix #891 #952

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

Merged
merged 1 commit into from
Nov 29, 2023
Merged

Fix #891 #952

merged 1 commit into from
Nov 29, 2023

Conversation

kddubey
Copy link
Contributor
@kddubey kddubey commented Nov 28, 2023

Fix #891

As noted in the Python docs, objects can get nullified on interpreter shutdown in __del__. The solution follows the same pattern here

How has this been tested?

  1. Install a later version of transformers with torch:

    python -m pip install "transformers[torch]>=4.35.0"
    
  2. Checkout main

    git checkout main
    
  3. Verify that this command prints out the ignored Exception:

    python -c "import transformers; from llama_cpp import Llama; llm = Llama(model_path='./some.gguf', verbose=False)"
    
  4. Checkout this branch

    git checkout ignore-warnings-on-shutdown
    
  5. Verify that the same command does not print out the ignored Exception:

    python -c "import transformers; from llama_cpp import Llama; llm = Llama(model_path='./some.gguf', verbose=False)"
    

@kddubey
Copy link
Contributor Author
kddubey commented Nov 28, 2023

@abetlen if this looks good, apply the same changes to your (awesome!) PR here

@abetlen
Copy link
Owner
abetlen commented Nov 29, 2023

This is perfect, thank you!

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.

llama_cpp conflict with transformers library
2 participants
0