Replies: 1 comment
-
🤖 Hello @burberg92, nice to see you again! I hope you're doing well. Based on the information you've provided, it seems you're looking to implement an async version of Here's how you can use it: class YourEmbedding(BaseEmbedding):
# Your implementation details...
async def aget_text_embedding_batch(
self, texts: List[str], show_progress: bool = False
) -> List[Embedding]:
return await super().aget_text_embedding_batch(texts, show_progress) In this code, Remember, you need to implement the class YourEmbedding(BaseEmbedding):
# Your implementation details...
async def _aget_text_embedding(self, text: str) -> Embedding:
# Your async implementation here... This way, you can speed up the generation of embeddings by processing multiple texts concurrently. You can find more details about this in the BaseEmbedding file. Regarding your question about the I hope this helps! If you have any other questions or need further clarification, feel free to ask. Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
Hi, I was looking to work with cohere embeddings and I really need to speed up the embedding generation. After looking at llamaindex I noticed that it does not support async batch generation.
these are the current functions for generating embeddings for cohere:
I believe that it is missing an async version of get_text_embeddings. This would greatly speed up the generation of embeddings. How can I implement this? or what strategies would be recommended to speed up the generation of embeddings for cohere?
Alternatively, I see that in the BaseEmbedding file there is a function called aget_text_embedding_batch, which is what I want to do. How can I use this?
I only want to generate the embeddings from a list of text, not create an index. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions