Local Ollama package shadows pip ollama - #288
Open
Salvatore-tech wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dear maintainers, i've been trying to run the examples/tutorial.ipynb notebook, using an Ollama language model without success.
This PR solves specifically the following error:
AttributeError: module 'ollama' has no attribute 'Client'
Of course in my environment i had the ollama client installed, but still i could not istantiate:
model = OllamaLanguageModel(MODEL_NAME)After some digging i found out that the OllamaLanguageModel is inserted in a local package having the same name of the pip package (ollama). In the image attached you can verify the shadowing of names between the local dir and pip ollama.

So in this patch i renamed the local package to ollama_lm (lm stands for language model, but better names are welcome) and after restarting the kernel i was able to create the model successfully.