mirascope icon indicating copy to clipboard operation
mirascope copied to clipboard

Add support for HuggingFace embeddings (i.e. HuggingFaceEmbedder)

Open brenkao opened this issue 9 months ago • 0 comments

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/#/

brenkao avatar May 07 '24 23:05 brenkao