mirascope
mirascope copied to clipboard
Add support for HuggingFace embeddings (i.e. HuggingFaceEmbedder)
Is your feature request related to a problem? Please describe. Similar to HuggingFaceCall, you can already extend OpenAIEmbedder to use huggingface models.
class HuggingFaceEmbedder(OpenAIEmbedder):
embedding_params = OpenAIEmbeddingParams(model="nomic-ai/nomic-embed-text-v1.5")
api_key = "-"
base_url = "http://localhost:8080"
but would be nice to have direct integration.
Describe the solution you'd like
An embedding interface similar to OpenAIEmbedder
that extends BaseEmbedder
, but with more direct integration with huggingface text-embeddings-inference.
Additional context Here is the API reference. https://huggingface.github.io/text-embeddings-inference/#/