Skip to content

Commit

Permalink
docs(huggingface.md): adding huggingface text-embedding-inference to …
Browse files Browse the repository at this point in the history
…docs
  • Loading branch information
krrishdholakia committed Oct 25, 2023
1 parent 822b0b5 commit 046e138
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/my-website/docs/providers/huggingface.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ print(response)
</TabItem>
</Tabs>

## Usage - Streaming
## Streaming

<a target="_blank" href="https://colab.research.google.com/github/BerriAI/litellm/blob/main/cookbook/LiteLLM_HuggingFace.ipynb">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
Expand Down Expand Up @@ -116,6 +116,18 @@ for chunk in response:
print(chunk)
```

## Embedding
LiteLLM supports Huggingface's [text-embedding-inference](https://github.com/huggingface/text-embeddings-inference) format.
```python
from litellm import embedding
import os
os.environ['HUGGINGFACE_API_KEY'] = ""
response = embedding(
model='huggingface/microsoft/codebert-base',
input=["good morning from litellm"]
)
```

### [OPTIONAL] API KEYS + API BASE
If required, you can set the api key + api base, set it in your os environment. [Code for how it's sent](https://github.com/BerriAI/litellm/blob/0100ab2382a0e720c7978fbf662cc6e6920e7e03/litellm/llms/huggingface_restapi.py#L25)

Expand Down

0 comments on commit 046e138

Please sign in to comment.