(config: EmbeddingModelInfo = local_embedding_model)
| 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): |