Closed jsconan closed 2 months ago
Can you please re-install langchain-google-vertexai
from Github, and try again? I believe there was a bug that was fixed last week.
P.S. Don't forget you need to uninstall the existing version before installing from Github.
Thank you @lkuligin Indeed, the GitHub version does not have the issue. I am waiting now for its release.
In the meantime, here is a way to make it work, with pip
:
pip uninstall langchain-google-vertexai
pip install git+ssh://git@github.com/langchain-ai/langchain-google.git#subdirectory=libs/vertexai
Checked other resources
Description
I'm splitting documents using SemanicChunker with VertexAIEmbeddings. When the number of chunks is high enough (more than ~120), I'm getting
IndexError: list index out of range
.Please note that the issue does not occur when using the previous implementation from
langchain.embeddings.VertexAIEmbeddings
, but it obviously triggers a deprecation warning.The problem seems to come from the batch-size calculation, in
langchain_google_vertexai/embeddings.py
, which produces arbitrarily low values for the batch size, despite the total number of texts being higher. More exactly, the first batch is ok, but the second has a lower size despite the remaining number of chunks should produce more batches.Example Code
Error Message and Stack Trace (if applicable)
System Info
langchain==0.2.6 langchain-community==0.2.6 langchain-core==0.2.11 langchain-experimental==0.0.62 langchain-google-community==1.0.6 langchain-google-vertexai==1.0.6 langchain-text-splitters==0.2.1
Mac M3 Pro (macOS 14.5) Python 3.12