내용으로 건너뛰기

Selecting embedding size in BedrockEmbedding titan v1 and v2, switching dimensions dynamically via keyword arguments using langchain

0

I am trying to provide dimension argument while trying to fetch the Titan version 1 and version 2 embedding models, but the BedrockEmbedding class does not have the feature of dimension, It only provideds the default 1024 dimension. How can we solve this?

Below is how i am calling BedrockEmbedding from langchain_community.embeddings import BedrockEmbeddings

질문됨 2년 전878회 조회

1개 답변
1

Hi,

You don't have to provide the embeddings dimensions in the query: the model that you select (via its id) will return the number of dimensions that it is programmed for.

So, if you work with multiple embedding engines, your code must be ready to work with variable numbers of dimensions depending on the model that you query.

Best,

Didier

전문가

답변함 2년 전

전문가

검토됨 2년 전

전문가

검토됨 2년 전

  • Currently, our solution selects the model_id and defaults the text embedding dimensions to 1536 for Titan version 1 and 1024 for Titan version 2. However, we aim to test our dataset with various embedding sizes, such as 256, 512, and 1024.

    How can we dynamically set the embedding dimension for both Titan version 1 and version 2 using the Langchain Community BedrockEmbedding? The model keyword arguments do not seem to accept dimension specifications.

    How do we dynamically select the embedding dimension for both Titan version 1 and version 2 during testing.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠