Skip to content

Commit 653aefd

Browse files
Merge branch 'main' into litellm_async_cohere_calls
2 parents 9b2eb17 + 3a70849 commit 653aefd

File tree

8 files changed

+362
-64
lines changed

8 files changed

+362
-64
lines changed

docs/my-website/docs/embedding/supported_embedding.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ response = embedding(
270270
| embed-multilingual-v2.0 | `embedding(model="embed-multilingual-v2.0", input=["good morning from litellm", "this is another item"])` |
271271

272272
## HuggingFace Embedding Models
273-
LiteLLM supports all Feature-Extraction Embedding models: https://huggingface.co/models?pipeline_tag=feature-extraction
273+
LiteLLM supports all Feature-Extraction + Sentence Similarity Embedding models: https://huggingface.co/models?pipeline_tag=feature-extraction
274274

275275
### Usage
276276
```python
@@ -282,6 +282,25 @@ response = embedding(
282282
input=["good morning from litellm"]
283283
)
284284
```
285+
286+
### Usage - Set input_type
287+
288+
LiteLLM infers input type (feature-extraction or sentence-similarity) by making a GET request to the api base.
289+
290+
Override this, by setting the `input_type` yourself.
291+
292+
```python
293+
from litellm import embedding
294+
import os
295+
os.environ['HUGGINGFACE_API_KEY'] = ""
296+
response = embedding(
297+
model='huggingface/microsoft/codebert-base',
298+
input=["good morning from litellm", "you are a good bot"],
299+
api_base = "https://p69xlsj6rpno5drq.us-east-1.aws.endpoints.huggingface.cloud",
300+
input_type="sentence-similarity"
301+
)
302+
```
303+
285304
### Usage - Custom API Base
286305
```python
287306
from litellm import embedding

litellm/llms/cohere.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#################### OLD ########################
2+
##### See `cohere_chat.py` for `/chat` calls ####
3+
#################################################
14
import json
25
import os
36
import time

0 commit comments

Comments
 (0)