Skip to content

Commit 5c929d6

Browse files
committed
update docs
1 parent 0f9e12f commit 5c929d6

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

docs/ml/providers.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
11
# Providers
22

3-
All providers implement `EmbeddingProvider<T>`
3+
All providers implement `EmbeddingProvider<T>`. Both bundled and downloaded models are supported. The recommended way to use downloaded models is via ModelManager.
44

5+
## Examples
6+
7+
### Downloaded model
8+
9+
```kotlin
10+
val textEmbedder = ModelManager.getTextEmbedder(application, ModelName.ALL_MINILM_L6_V2)
11+
val imageEmbedder = ModelManager.getImageEmbedder(application, ModelName.DINOV2_SMALL)
12+
```
13+
14+
### Bundled model
15+
16+
```kotlin
17+
val textEmbedder = ClipTextEmbedder(application, ModelAssetSource.Resource(R.raw.clip_text_encoder_quant), vocabSource = ModelAssetSource.Resource(R.raw.vocab), mergesSource = ModelAssetSource.Resource(R.raw.merges))
18+
val imageEmbedder = ClipImageEmbedder(application, ModelAssetSource.Resource(R.raw.clip_image_encoder_quant))
19+
```
20+
``
521
## Supported image embedders
622

723
* dinov2_small

0 commit comments

Comments
 (0)