forked from codefuse-ai/ModelCache
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path__init__.py
More file actions
40 lines (26 loc) · 1.38 KB
/
__init__.py
File metadata and controls
40 lines (26 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- coding: utf-8 -*-
from modelcache.utils.lazy_import import LazyImport
huggingface = LazyImport("huggingface", globals(), "modelcache.embedding.huggingface")
data2vec = LazyImport("data2vec", globals(), "modelcache.embedding.data2vec")
llmEmb = LazyImport("llmEmb", globals(), "modelcache.embedding.llmEmb")
fasttext = LazyImport("fasttext", globals(), "modelcache.embedding.fasttext")
paddlenlp = LazyImport("paddlenlp", globals(), "modelcache.embedding.paddlenlp")
timm = LazyImport("timm", globals(), "modelcache.embedding.timm")
huggingface_tei = LazyImport("huggingface_tei", globals(), "modelcache.embedding.huggingface_tei")
bge_m3 = LazyImport("bge_m3", globals(), "modelcache.embedding.bge_m3")
def Huggingface(model="sentence-transformers/all-mpnet-base-v2"):
return huggingface.Huggingface(model)
def Data2VecAudio(model="model/text2vec-base-chinese/"):
return data2vec.Data2VecAudio(model)
def LlmEmb2vecAudio():
return llmEmb.LlmEmb2Vec()
def FastText(model="en", dim=None):
return fasttext.FastText(model, dim)
def PaddleNLP(model="ernie-3.0-medium-zh"):
return paddlenlp.PaddleNLP(model)
def Timm(model="resnet50", device="default"):
return timm.Timm(model, device)
def HuggingfaceTEI(base_url, model):
return huggingface_tei.HuggingfaceTEI(base_url, model)
def BgeM3Embedding(model_path="model/bge-m3"):
return bge_m3.BgeM3Embedding(model_path)