xinference.client.handlers.EmbeddingModelHandle.create_embedding#

EmbeddingModelHandle.create_embedding(input: str | List[str], **kwargs) Embedding#

Create an Embedding from user input via RESTful APIs.

参数:

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.

返回:

The resulted Embedding vector that can be easily consumed by machine learning models and algorithms.

返回类型:

Embedding

抛出:

RuntimeError -- Report the failure of embeddings and provide the error message.