Przejdź do głównej zawartości

Class: ClipEmbedding

Extends

Constructors

new ClipEmbedding()

new ClipEmbedding(): ClipEmbedding

Returns

ClipEmbedding

Inherited from

MultiModalEmbedding . constructor

Properties

embedBatchSize

embedBatchSize: number = DEFAULT_EMBED_BATCH_SIZE

Inherited from

MultiModalEmbedding . embedBatchSize

Source

packages/llamaindex/src/embeddings/types.ts:21


embedInfo?

optional embedInfo: EmbeddingInfo

Inherited from

MultiModalEmbedding . embedInfo

Source

packages/llamaindex/src/embeddings/types.ts:22


modelType

modelType: ClipEmbeddingModelType = ClipEmbeddingModelType.XENOVA_CLIP_VIT_BASE_PATCH16

Source

packages/llamaindex/src/embeddings/ClipEmbedding.ts:30


processor

private processor: null | Processor = null

Source

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


textModel

private textModel: null | CLIPTextModelWithProjection = null

Source

packages/llamaindex/src/embeddings/ClipEmbedding.ts:36


tokenizer

private tokenizer: null | PreTrainedTokenizer = null

Source

packages/llamaindex/src/embeddings/ClipEmbedding.ts:33


visionModel

private visionModel: null | CLIPVisionModelWithProjection = null

Source

packages/llamaindex/src/embeddings/ClipEmbedding.ts:35

Methods

getImageEmbedding()

getImageEmbedding(image): Promise<number[]>

Parameters

image: ImageType

Returns

Promise<number[]>

Overrides

MultiModalEmbedding . getImageEmbedding

Source

packages/llamaindex/src/embeddings/ClipEmbedding.ts:76


getImageEmbeddings()

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

Optionally override this method to retrieve multiple image embeddings in a single request

Parameters

images: ImageType[]

Returns

Promise<number[][]>

Inherited from

MultiModalEmbedding . getImageEmbeddings

Source

packages/llamaindex/src/embeddings/MultiModalEmbedding.ts:24


getProcessor()

getProcessor(): Promise<Processor>

Returns

Promise<Processor>

Source

packages/llamaindex/src/embeddings/ClipEmbedding.ts:46


getQueryEmbedding()

getQueryEmbedding(query): Promise<null | number[]>

Parameters

query: MessageContentDetail

Returns

Promise<null | number[]>

Inherited from

MultiModalEmbedding . getQueryEmbedding

Source

packages/llamaindex/src/embeddings/MultiModalEmbedding.ts:58


getTextEmbedding()

getTextEmbedding(text): Promise<number[]>

Parameters

text: string

Returns

Promise<number[]>

Overrides

MultiModalEmbedding . getTextEmbedding

Source

packages/llamaindex/src/embeddings/ClipEmbedding.ts:83


getTextEmbeddings()

getTextEmbeddings(texts): Promise<number[][]>

Optionally override this method to retrieve multiple embeddings in a single request

Parameters

texts: string[]

Returns

Promise<number[][]>

Inherited from

MultiModalEmbedding . getTextEmbeddings

Source

packages/llamaindex/src/embeddings/types.ts:48


getTextEmbeddingsBatch()

getTextEmbeddingsBatch(texts, options?): Promise<number[][]>

Get embeddings for a batch of texts

Parameters

texts: string[]

options?

options.logProgress?: boolean

Returns

Promise<number[][]>

Inherited from

MultiModalEmbedding . getTextEmbeddingsBatch

Source

packages/llamaindex/src/embeddings/types.ts:64


getTextModel()

getTextModel(): Promise<CLIPTextModelWithProjection>

Returns

Promise<CLIPTextModelWithProjection>

Source

packages/llamaindex/src/embeddings/ClipEmbedding.ts:65


getTokenizer()

getTokenizer(): Promise<PreTrainedTokenizer>

Returns

Promise<PreTrainedTokenizer>

Source

packages/llamaindex/src/embeddings/ClipEmbedding.ts:38


getVisionModel()

getVisionModel(): Promise<CLIPVisionModelWithProjection>

Returns

Promise<CLIPVisionModelWithProjection>

Source

packages/llamaindex/src/embeddings/ClipEmbedding.ts:54


similarity()

similarity(embedding1, embedding2, mode): number

Parameters

embedding1: number[]

embedding2: number[]

mode: SimilarityType= SimilarityType.DEFAULT

Returns

number

Inherited from

MultiModalEmbedding . similarity

Source

packages/llamaindex/src/embeddings/types.ts:24


transform()

transform(nodes, _options?): Promise <BaseNode <Metadata>[]>

Parameters

nodes: BaseNode <Metadata>[]

_options?: any

Returns

Promise <BaseNode <Metadata>[]>

Inherited from

MultiModalEmbedding . transform

Source

packages/llamaindex/src/embeddings/MultiModalEmbedding.ts:30


truncateMaxTokens()

truncateMaxTokens(input): string[]

Parameters

input: string[]

Returns

string[]

Inherited from

MultiModalEmbedding . truncateMaxTokens

Source

packages/llamaindex/src/embeddings/types.ts:90