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

Method get_model

backend/apps/ai_model/embedding.py:52–63  ·  view source on GitHub ↗
(key: str = settings.DEFAULT_EMBEDDING_MODEL,
                  config: EmbeddingModelInfo = local_embedding_model)

Source from the content-addressed store, hash-verified

50
51 @staticmethod
52 def get_model(key: str = settings.DEFAULT_EMBEDDING_MODEL,
53 config: EmbeddingModelInfo = local_embedding_model) -> Embeddings:
54 model_instance = _embedding_model.get(key)
55 if model_instance is None:
56 lock = EmbeddingModelCache._get_lock(key)
57 with lock:
58 model_instance = _embedding_model.get(key)
59 if model_instance is None:
60 model_instance = EmbeddingModelCache._new_instance(config)
61 _embedding_model[key] = model_instance
62
63 return model_instance

Callers 9

save_embeddingsFunction · 0.80
get_ds_embeddingFunction · 0.80
get_table_embeddingFunction · 0.80
calc_table_embeddingFunction · 0.80
save_table_embeddingFunction · 0.80
save_ds_embeddingFunction · 0.80
save_embeddingsFunction · 0.80

Calls 3

_get_lockMethod · 0.80
_new_instanceMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected