Skip to content

Commit 01acdcd

Browse files
committed
fix: rename huggingface TEI class
1 parent c9f6a2f commit 01acdcd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

modelcache/embedding/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
fasttext = LazyImport("fasttext", globals(), "modelcache.embedding.fasttext")
77
paddlenlp = LazyImport("paddlenlp", globals(), "modelcache.embedding.paddlenlp")
88
timm = LazyImport("timm", globals(), "modelcache.embedding.timm")
9-
text_embeddings_inference = LazyImport("text_embeddings_inference", globals(), "modelcache.embedding.text_embeddings_inference")
9+
huggingface_tei = LazyImport("huggingface_tei", globals(), "modelcache.embedding.huggingface_tei")
1010

1111

1212
def Huggingface(model="sentence-transformers/all-mpnet-base-v2"):
@@ -33,4 +33,4 @@ def Timm(model="resnet50", device="default"):
3333
return timm.Timm(model, device)
3434

3535
def TextEmbeddingsInference(base_url, model):
36-
return text_embeddings_inference.TextEmbeddingsInference(base_url, model)
36+
return huggingface_tei.HuggingfaceTEI(base_url, model)

modelcache/embedding/text_embeddings_inference.py renamed to modelcache/embedding/huggingface_tei.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import numpy as np
44
from modelcache.embedding.base import BaseEmbedding
55

6-
class TextEmbeddingsInference(BaseEmbedding):
6+
class HuggingfaceTEI(BaseEmbedding):
77
def __init__(self, base_url: str, model: str):
88
self.base_url = base_url
99
self.model = model
@@ -12,6 +12,7 @@ def __init__(self, base_url: str, model: str):
1212
'Content-Type': 'application/json',
1313
}
1414
self.__dimension = self.to_embeddings('test').shape[0]
15+
1516
def to_embeddings(self, data, **_):
1617
json_data = {
1718
'input': data,

0 commit comments

Comments
 (0)