Getting a "batch size should not be larger than 2048" error, but only when
use_async=True
Offending Line:
VectorStoreIndex(nodes, storage_context=storage_context, use_async=True)
Error:
File ~/superwallet/env/lib/python3.11/site-packages/tenacity/_asyncio.py:50, in AsyncRetrying.__call__(self, fn, *args, **kwargs)
49 try:
---> 50 result = await fn(*args, **kwargs)
51 except BaseException: # noqa: B902
File ~/superwallet/env/lib/python3.11/site-packages/llama_index/embeddings/openai.py:167, in aget_embeddings(list_of_text, engine, **kwargs)
158 """Asynchronously get embeddings.
159
160 NOTE: Copied from OpenAI's embedding utils:
(...)
165
166 """
--> 167 assert len(list_of_text) <= 2048, "The batch size should not be larger than 2048."
169 # replace newlines, which can negatively affect performance.
AssertionError: The batch size should not be larger than 2048.