-
Notifications
You must be signed in to change notification settings - Fork 901
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
fix: add ollama embedding config and fix sqlite_vec db #1255
base: main
Are you sure you want to change the base?
Conversation
llama_stack/providers/inline/vector_io/sqlite_vec/sqlite_vec.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment inline
Thanks for your help! I run pre-commit locally and everything looks good, not sure why pre-commit failed at CI
|
@ashwinb Can you take another look at this PR? somehow the pre-commit is blocking it, I am not sure how to solve |
@@ -162,7 +162,7 @@ def __init__(self, config, inference_api: Api.inference) -> None: | |||
|
|||
async def initialize(self) -> None: | |||
# Open a connection to the SQLite database (the file is specified in the config). | |||
self.connection = sqlite3.connect(self.config.db_path) | |||
self.connection = sqlite3.connect(self.config.db_path, check_same_thread=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to fetch and rebase to latest |
@ashwinb Thanks for the guidance, I followed his example and tested with my RAG app. Can you take another look? |
|
||
async def initialize(self) -> None: | ||
# Open a connection to the SQLite database (the file is specified in the config). | ||
self.connection = sqlite3.connect(self.config.db_path) | ||
self.connection = self._get_connection() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this isn't quite right. you cannot assign whatever value you get into an instance variable. you must use conn = self._get_connection()
anywhere you need to use a connection.
What does this PR do?
RAG+Ollama is not working, as I encounter errors:
Embeddings are now served via Inference providers.
Taking a closer look it seems that the embedding model yaml config has been removed here, this PR will add the config back so user can use the embedding model after theyollama run all-minilm:latest
.Then, sqlite_vec also give error
SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 8349485120 and this is thread id 6325039104
, I think we need to useself.connection = sqlite3.connect(self.config.db_path, check_same_thread=False)
instead in :llama-stack/llama_stack/providers/inline/vector_io/sqlite_vec/sqlite_vec.py
Line 165 in 1a044ef
Test Plan
[Describe the tests you ran to verify your changes with result summaries. Provide clear instructions so the plan can be easily re-executed.]
Tested with my DocQA app