OpenCLIPEmbeddings#

class langchain_experimental.open_clip.open_clip.OpenCLIPEmbeddings[source]#

Bases: BaseModel, Embeddings

OpenCLIP Embeddings model.

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

param checkpoint: str = 'laion2b_s32b_b79k'#
param model: Any = None#
param model_name: str = 'ViT-H-14'#
param preprocess: Any = None#
param tokenizer: Any = None#
async aembed_documents(texts: List[str]) List[List[float]]#

Asynchronous Embed search docs.

Parameters:

texts (List[str]) – List of text to embed.

Returns:

List of embeddings.

Return type:

List[List[float]]

async aembed_query(text: str) List[float]#

Asynchronous Embed query text.

Parameters:

text (str) – Text to embed.

Returns:

Embedding.

Return type:

List[float]

embed_documents(texts: List[str]) List[List[float]][source]#

Embed search docs.

Parameters:

texts (List[str]) – List of text to embed.

Returns:

List of embeddings.

Return type:

List[List[float]]

embed_image(uris: List[str]) List[List[float]][source]#
Parameters:

uris (List[str]) –

Return type:

List[List[float]]

embed_query(text: str) List[float][source]#

Embed query text.

Parameters:

text (str) – Text to embed.

Returns:

Embedding.

Return type:

List[float]

Examples using OpenCLIPEmbeddings