Anyscale 임베딩

Anyscale 임베딩 (Anyscale Embeddings)

Anyscale Endpoints를 통해 Anyscale 임베딩을 사용하는 방법을 보여주는 가이드예요. 설치하고 임베딩 모델을 만들어 텍스트를 벡터화하는 간단한 흐름이에요.

출처: 문서

본문

이 가이드는 Anyscale Endpoints를 통해 Anyscale 임베딩을 사용하는 방법을 보여줘요.

colab에서 이 노트북을 열고 있다면 LlamaIndex 🦙를 설치해야 할 거예요.

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


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