-
Notifications
You must be signed in to change notification settings - Fork 907
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
PG Vector not working #659
Comments
@andreped I thought I'd mention you as it looks like you are the author of these changes. |
Hello, @edlouth :] Thank you for reporting the bug! I was surprised the PR I made was merged so quickly. I don't think we did thorough testing on it, especially not integration tests. But I can draft a PR on this today :] |
OK, great! Then I can review and test it on my local setup :] EDIT: Yeah, your proposed changes makes sense. I have an async implementation of this for another project, and I think I just mixed the two, as this implementation currently have to remain sync. |
While we are here I have also had some issues with vanna/src/vanna/pgvector/pgvector.py Line 32 in c21d8bf
I think this works from sentence_transformers import SentenceTransformer
model = SentenceTransformer('all-MiniLM-L6-v2')
# Define a custom embedding class with the necessary methods
class CustomEmbeddingFunction:
def __init__(self, model):
self.model = model
def embed_documents(self, texts):
# Return embeddings for documents
return self.model.encode(texts, convert_to_tensor=False)
def embed_query(self, text):
# Return embedding for a query
return self.model.encode([text], convert_to_tensor=False)[0]
self.embedding_function = CustomEmbeddingFunction(model) |
Again, we do exactly this for another project :P But if I recall correctly, you should be able to provide your own custom embedding function through |
Hi @edlouth, could you please guide me on how to utilize vanna.pgvector? I attempted to install Vanna with pgvector using |
Hello, @VirendraSttl :] There has yet to be made a release including the new A way to install the latest, could be to do something like this below:
Then again, as this seems broken right now, and has been addressed in the PR by @edlouth, but has yet to be merged, I would install Vanna through the following to get proper pgvector support:
At least something like that should work. |
Hi @andreped, I am trying to use pgvector as a custom vector database and I have copied the pgvector to my project. ../.pyenv/versions/3.12.6/lib/python3.12/site-packages/langchain_postgres/vectorstores.py", line 106, in _get_embedding_collection_store I tried to run in python 3.12 and 3.11, changed pgvector and langchain_postgres versions, but none worked. Which version of python are you using? Do you have any other suggestion? |
@isaacdalmarco I think we should wait till PR #660 is merged, as the code in the main branch for the pgvector implementation is broken. Then we can try to see how to fix this issue of yours, if it is still an issue after merge. |
@edlouth, @isaacdalmarco A new release of Could you try to upgrade to the latest version and test if this new version works well with you? :] |
Describe the bug
I have setup pg_vector like so:
I get the following error:
AttributeError: 'CustomVanna' object has no attribute 'documentation_collection'
If I run:
I get an error of
object of type 'coroutine' has no len()
The text was updated successfully, but these errors were encountered: