Skip to content

Commit

Permalink
fix HuggingFaceEmbedding deprecated in favor of HuggingFaceInferenceA…
Browse files Browse the repository at this point in the history
…PIEmbedding (#466)

* Fix HuggingFaceEmbedding deprecated in favor of HuggingFaceInferenceAPIEmbedding

Signed-off-by: rbrugaro <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: rbrugaro <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
rbrugaro and pre-commit-ci[bot] authored Aug 13, 2024
1 parent eb51018 commit 2891cc6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions comps/embeddings/llama_index/local_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

from langsmith import traceable
from llama_index.embeddings.huggingface import HuggingFaceEmbedding
from llama_index.embeddings.huggingface_api import HuggingFaceInferenceAPIEmbedding

from comps import EmbedDoc, ServiceType, TextDoc, opea_microservices, register_microservice

Expand All @@ -24,5 +24,5 @@ def embedding(input: TextDoc) -> EmbedDoc:


if __name__ == "__main__":
embeddings = HuggingFaceEmbedding(model_name="BAAI/bge-large-en-v1.5")
embeddings = HuggingFaceInferenceAPIEmbedding(model_name="BAAI/bge-large-en-v1.5")
opea_microservices["opea_service@local_embedding"].start()
1 change: 1 addition & 0 deletions comps/embeddings/llama_index/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ docarray[full]
fastapi
huggingface_hub
langsmith
llama-index-embeddings-huggingface-api
llama-index-embeddings-text-embeddings-inference
opentelemetry-api
opentelemetry-exporter-otlp
Expand Down

0 comments on commit 2891cc6

Please sign in to comment.