Skip to content

Local Ollama package shadows pip ollama - #288

Open
Salvatore-tech wants to merge 2 commits into
google-deepmind:mainfrom
Salvatore-tech:main
Open

Local Ollama package shadows pip ollama#288
Salvatore-tech wants to merge 2 commits into
google-deepmind:mainfrom
Salvatore-tech:main

Conversation

@Salvatore-tech

Copy link
Copy Markdown

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.
image

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.

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.

1 participant