-
Notifications
You must be signed in to change notification settings - Fork 563
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
Unable to close connections #441
Comments
Remarks: I know there is a keep_alive option, but in my case I just want to close connection instead of unloading the model from memory |
Hey! Can you point to your usage + what the OpenAI equivalent is? Thanks! |
My usage case 1 - using ollama python package
case 1 results in warning on exit:
case 2 - using openai equivalent
In case 2, the final line |
Could you try this and see if it helps - just as an experiment not recommending for actual usage: |
I tried your suggestion AttributeError: 'Client' object has no attribute 'close' |
Cool cool, thanks for testing. Will look into this and possibly expose something. Thanks for the report! |
I am looking forward to the fix. Currently, I am working on a project that supports 14 AI backends, of which only Ollama and Cohere are experiencing connection issues, while the rest are functioning properly. Since I have set Ollama as the default backend, the issue is somewhat embarrassing. |
After running ollama python library, I got resource warning ... socket not closed ... 11434 ...
I need a way to explicitly close the connection. However, the ollama client does not have a close method as openai client does.
Right now, I need to use openai library to connect to ollama server, to avoid the warning. with the openai library, I can close the connection with a close method.
I hope the ollama python library offers a way to close the connection. Appreciate your good work. Thanks.
The text was updated successfully, but these errors were encountered: