Back to Llama Index

Anyscale Embeddings

docs/examples/embeddings/Anyscale.ipynb

0.14.21907 B
Original Source

<a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/embeddings/OpenAI.ipynb" target="_parent"></a>

Anyscale Embeddings

This guide shows you how to use Anyscale Embeddings through Anyscale Endpoints.

If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.

python
%pip install llama-index-embeddings-anyscale
python
!pip install llama-index
python
from llama_index.embeddings.anyscale import AnyscaleEmbedding

embed_model = AnyscaleEmbedding(
    api_key=ANYSCALE_ENDPOINT_TOKEN, embed_batch_size=10
)
python
# Basic embedding example
embeddings = embed_model.get_text_embedding(
    "It is raining cats and dogs here!"
)
print(len(embeddings), embeddings[:10])