[Feature] Add support for python 3.13 and other migration related fixes (#1279)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
[alembic]
|
||||
# path to migration scripts
|
||||
script_location = embedchain/migrations
|
||||
script_location = embedchain:migrations
|
||||
|
||||
# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
|
||||
# Uncomment the line below if you want the files to be prepended with date and time
|
||||
|
||||
@@ -6,7 +6,7 @@ try:
|
||||
import pinecone
|
||||
except ImportError:
|
||||
raise ImportError(
|
||||
"Pinecone requires extra dependencies. Install with `pip install --upgrade 'embedchain[pinecone]'`"
|
||||
"Pinecone requires extra dependencies. Install with `pip install pinecone-text pinecone-client`"
|
||||
) from None
|
||||
|
||||
from pinecone_text.sparse import BM25Encoder
|
||||
@@ -102,9 +102,10 @@ class PineconeDB(BaseVectorDB):
|
||||
existing_ids = list()
|
||||
metadatas = []
|
||||
|
||||
batch_size = 100
|
||||
if ids is not None:
|
||||
for i in range(0, len(ids), 1000):
|
||||
result = self.pinecone_index.fetch(ids=ids[i : i + 1000])
|
||||
for i in range(0, len(ids), batch_size):
|
||||
result = self.pinecone_index.fetch(ids=ids[i : i + batch_size])
|
||||
vectors = result.get("vectors")
|
||||
batch_existing_ids = list(vectors.keys())
|
||||
existing_ids.extend(batch_existing_ids)
|
||||
|
||||
Reference in New Issue
Block a user