MCPcopy Index your code
hub / github.com/dataease/SQLBot / _new_instance

Method _new_instance

backend/apps/ai_model/embedding.py:33–37  ·  view source on GitHub ↗
(config: EmbeddingModelInfo = local_embedding_model)

Source from the content-addressed store, hash-verified

31
32 @staticmethod
33 def _new_instance(config: EmbeddingModelInfo = local_embedding_model):
34 return HuggingFaceEmbeddings(model_name=config.name, cache_folder=config.folder,
35 model_kwargs={'device': config.device},
36 encode_kwargs={'normalize_embeddings': True}
37 )
38
39 @staticmethod
40 def _get_lock(key: str = settings.DEFAULT_EMBEDDING_MODEL):

Callers 1

get_modelMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected