Skip to main content

Class: ClipEmbedding

Hierarchy

Constructors

constructor

new ClipEmbedding()

Inherited from

MultiModalEmbedding.constructor

Properties

modelType

modelType: ClipEmbeddingModelType = ClipEmbeddingModelType.XENOVA_CLIP_VIT_BASE_PATCH16

Defined in

packages/core/src/embeddings/ClipEmbedding.ts:10


processor

Private processor: any

Defined in

packages/core/src/embeddings/ClipEmbedding.ts:14


textModel

Private textModel: any

Defined in

packages/core/src/embeddings/ClipEmbedding.ts:16


tokenizer

Private tokenizer: any

Defined in

packages/core/src/embeddings/ClipEmbedding.ts:13


visionModel

Private visionModel: any

Defined in

packages/core/src/embeddings/ClipEmbedding.ts:15

Methods

getImageEmbedding

getImageEmbedding(image): Promise<number[]>

Parameters

NameType
imageImageType

Returns

Promise<number[]>

Overrides

MultiModalEmbedding.getImageEmbedding

Defined in

packages/core/src/embeddings/ClipEmbedding.ts:60


getImageEmbeddings

getImageEmbeddings(images): Promise<number[][]>

Parameters

NameType
imagesImageType[]

Returns

Promise<number[][]>

Inherited from

MultiModalEmbedding.getImageEmbeddings

Defined in

packages/core/src/embeddings/MultiModalEmbedding.ts:11


getProcessor

getProcessor(): Promise<any>

Returns

Promise<any>

Defined in

packages/core/src/embeddings/ClipEmbedding.ts:26


getQueryEmbedding

getQueryEmbedding(query): Promise<number[]>

Parameters

NameType
querystring

Returns

Promise<number[]>

Overrides

MultiModalEmbedding.getQueryEmbedding

Defined in

packages/core/src/embeddings/ClipEmbedding.ts:75


getTextEmbedding

getTextEmbedding(text): Promise<number[]>

Parameters

NameType
textstring

Returns

Promise<number[]>

Overrides

MultiModalEmbedding.getTextEmbedding

Defined in

packages/core/src/embeddings/ClipEmbedding.ts:67


getTextModel

getTextModel(): Promise<any>

Returns

Promise<any>

Defined in

packages/core/src/embeddings/ClipEmbedding.ts:47


getTokenizer

getTokenizer(): Promise<any>

Returns

Promise<any>

Defined in

packages/core/src/embeddings/ClipEmbedding.ts:18


getVisionModel

getVisionModel(): Promise<any>

Returns

Promise<any>

Defined in

packages/core/src/embeddings/ClipEmbedding.ts:34


similarity

similarity(embedding1, embedding2, mode?): number

Parameters

NameTypeDefault value
embedding1number[]undefined
embedding2number[]undefined
modeSimilarityTypeSimilarityType.DEFAULT

Returns

number

Inherited from

MultiModalEmbedding.similarity

Defined in

packages/core/src/embeddings/types.ts:14