Class: ClipEmbedding
Hierarchy
-
↳
ClipEmbedding
Constructors
constructor
• new ClipEmbedding(): ClipEmbedding
Returns
Inherited from
MultiModalEmbedding.constructor
Properties
embedBatchSize
• embedBatchSize: number
= DEFAULT_EMBED_BATCH_SIZE
Inherited from
MultiModalEmbedding.embedBatchSize
Defined in
packages/core/src/embeddings/types.ts:11
modelType
• modelType: ClipEmbeddingModelType
= ClipEmbeddingModelType.XENOVA_CLIP_VIT_BASE_PATCH16
Defined in
packages/core/src/embeddings/ClipEmbedding.ts:25
processor
• Private
processor: any
Defined in
packages/core/src/embeddings/ClipEmbedding.ts:29
textModel
• Private
textModel: any
Defined in
packages/core/src/embeddings/ClipEmbedding.ts:31
tokenizer
• Private
tokenizer: any
Defined in
packages/core/src/embeddings/ClipEmbedding.ts:28
visionModel
• Private
visionModel: any
Defined in
packages/core/src/embeddings/ClipEmbedding.ts:30
Methods
getImageEmbedding
▸ getImageEmbedding(image
): Promise
<number
[]>
Parameters
Name | Type |
---|---|
image | ImageType |
Returns
Promise
<number
[]>
Overrides
MultiModalEmbedding.getImageEmbedding
Defined in
packages/core/src/embeddings/ClipEmbedding.ts:83
getImageEmbeddings
▸ getImageEmbeddings(images
): Promise
<number
[][]>
Optionally override this method to retrieve multiple image embeddings in a single request
Parameters
Name | Type |
---|---|
images | ImageType [] |
Returns
Promise
<number
[][]>
Inherited from
MultiModalEmbedding.getImageEmbeddings
Defined in
packages/core/src/embeddings/MultiModalEmbedding.ts:20
getProcessor
▸ getProcessor(): Promise
<any
>
Returns
Promise
<any
>
Defined in
packages/core/src/embeddings/ClipEmbedding.ts:44
getQueryEmbedding
▸ getQueryEmbedding(query
): Promise
<number
[]>
Parameters
Name | Type |
---|---|
query | string |
Returns
Promise
<number
[]>
Overrides
MultiModalEmbedding.getQueryEmbedding
Defined in
packages/core/src/embeddings/ClipEmbedding.ts:98
getTextEmbedding
▸ getTextEmbedding(text
): Promise
<number
[]>
Parameters
Name | Type |
---|---|
text | string |
Returns
Promise
<number
[]>
Overrides
MultiModalEmbedding.getTextEmbedding
Defined in
packages/core/src/embeddings/ClipEmbedding.ts:90
getTextEmbeddings
▸ getTextEmbeddings(texts
): Promise
<number
[][]>
Optionally override this method to retrieve multiple embeddings in a single request
Parameters
Name | Type |
---|---|
texts | string [] |
Returns
Promise
<number
[][]>
Inherited from
MultiModalEmbedding.getTextEmbeddings
Defined in
packages/core/src/embeddings/types.ts:28
getTextEmbeddingsBatch
▸ getTextEmbeddingsBatch(texts
, options?
): Promise
<number
[][]>
Get embeddings for a batch of texts
Parameters
Name | Type |
---|---|
texts | string [] |
options? | Object |
options.logProgress? | boolean |
Returns
Promise
<number
[][]>
Inherited from
MultiModalEmbedding.getTextEmbeddingsBatch
Defined in
packages/core/src/embeddings/types.ts:44
getTextModel
▸ getTextModel(): Promise
<any
>
Returns
Promise
<any
>
Defined in
packages/core/src/embeddings/ClipEmbedding.ts:69
getTokenizer
▸ getTokenizer(): Promise
<any
>
Returns
Promise
<any
>
Defined in
packages/core/src/embeddings/ClipEmbedding.ts:33
getVisionModel
▸ getVisionModel(): Promise
<any
>
Returns
Promise
<any
>
Defined in
packages/core/src/embeddings/ClipEmbedding.ts:55
similarity
▸ similarity(embedding1
, embedding2
, mode?
): number
Parameters
Name | Type | Default value |
---|---|---|
embedding1 | number [] | undefined |
embedding2 | number [] | undefined |
mode | SimilarityType | SimilarityType.DEFAULT |
Returns
number
Inherited from
MultiModalEmbedding.similarity
Defined in
packages/core/src/embeddings/types.ts:13
transform
▸ transform(nodes
, _options?
): Promise
<BaseNode
<Metadata
>[]>
Parameters
Name | Type |
---|---|
nodes | BaseNode <Metadata >[] |
_options? | any |