xinference.client.handlers.EmbeddingModelHandle.create_embedding#
- EmbeddingModelHandle.create_embedding(input: str | List[str], **kwargs) Embedding #
Create an Embedding from user input via RESTful APIs.
- Parameters:
input (Union[str, List[str]]) – Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays.
- Returns:
The resulted Embedding vector that can be easily consumed by machine learning models and algorithms.
- Return type:
Embedding
- Raises:
RuntimeError – Report the failure of embeddings and provide the error message.