HuggingFaceEncoder Objects
__call__
docs
(List[str]
): A list of documents to encode.batch_size
: The batch size for encoding.
HFEndpointEncoder Objects
__init__
name
(str
): The name of the encoder.huggingface_url
(str
): The URL of the Hugging Face API endpoint.huggingface_api_key
(str
): The API key for the Hugging Face API.score_threshold
(float
): A threshold for processing the embeddings.
ValueError
: If eitherhuggingface_url
orhuggingface_api_key
is None.
__call__
docs
(List[str]
): A list of documents to encode.
ValueError
: If no embeddings are returned for a document.
List[List[float]]
: A list of embeddings for the given documents.
query
payload
(dict
): The payload to send in the request.
ValueError
: If the query fails or the response status is not 200.
dict
: The response from the Hugging Face API.