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

Moved Ollama implementation to ollama.py; removed redundant import in mistral.py; minor linting in both #259

Merged
merged 3 commits into from
Mar 20, 2024

Conversation

andreped
Copy link
Contributor

@andreped andreped commented Feb 23, 2024

Just observed this when I was addressing PR #239.

To ensure that everything was OK, I also looked at the Mistral implementation and found a redundant import.
I then linted both using the pre-commit hooks. Feature-wise there should not be any major changes.

With this PR, users should be able to import ollama in the same way as done for mistral:

from vanna.mistral.mistral import Mistral
from vanna.ollama.ollama import Ollama

I believe this import will be slightly different in the current main branch, as the Ollama implementation currently lies in the ollama/__init__.py instead of the ollama/ollama.py file.

@andreped
Copy link
Contributor Author

@zainhoda Any thoughts on this PR? Looks rather straight forward?

@zainhoda zainhoda merged commit c8201f5 into vanna-ai:main Mar 20, 2024
@skoschik
Copy link

I've recently been exploring the Vanna Ollama import documentation on the vanna.ai website and noticed that there appears to be a discrepancy between the current implementation details and the documentation provided at https://vanna.ai/docs/postgres-ollama-chromadb/. (probably elsewhere ollama import is mentioned)

The docs suggest
from vanna.ollama import Ollama
but is now
from vanna.ollama.ollama import Ollama

I wasn't sure if the documentation was managed directly within the GitHub repository or maintained separately. If it's on GitHub and contributions are welcome, I'd be happy to help with updating the documentation to reflect the current state of the project.

Thank you for your hard work on this project, and I look forward to your guidance on how best to proceed with this observation.

@zainhoda
Copy link
Contributor

@skoschik thanks for reporting this! So I'd actually prefer to have the format be:

from vanna.ollama import Ollama

IIRC, in src/vanna/ollama/init.py if we import the class, then I think this should work?

@andreped
Copy link
Contributor Author

IIRC, in src/vanna/ollama/init.py if we import the class, then I think this should work?

Yes, something like this should work. I can make a PR to address this, if you want? :]

@zainhoda
Copy link
Contributor

zainhoda commented Mar 29, 2024 via email

@andreped
Copy link
Contributor Author

andreped commented Mar 29, 2024

That would be great!

Wouldn't we need to apply the same to other models like Mistral as well?


EDIT: Just checked. There seems like most, if not all, model clients have the same issue. I will try to address this in one PR.

@zainhoda
Copy link
Contributor

zainhoda commented Mar 29, 2024 via email

@andreped
Copy link
Contributor Author

Made a PR #321. Let's discuss this further there :]

@andreped
Copy link
Contributor Author

andreped commented Mar 29, 2024

In this specific case, we have users who had a way of importing that is now broken

No worries. My PR will allow for both types of imports. Same applies to some other submodules. I updated the PR to extend this to other relevant submodules.

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