Changed default local model to nomic (#1943)

This commit is contained in:
hagen-danswer
2024-07-31 18:54:02 -07:00
committed by GitHub
parent 1654378850
commit 1be1959d80
12 changed files with 78 additions and 28 deletions

View File

@@ -199,7 +199,14 @@ def get_embedding_model(
if model_name not in _GLOBAL_MODELS_DICT:
logger.info(f"Loading {model_name}")
model = SentenceTransformer(model_name)
# Some model architectures that aren't built into the Transformers or Sentence
# Transformer need to be downloaded to be loaded locally. This does not mean
# data is sent to remote servers for inference, however the remote code can
# be fairly arbitrary so only use trusted models
model = SentenceTransformer(
model_name_or_path=model_name,
trust_remote_code=True,
)
model.max_seq_length = max_context_length
_GLOBAL_MODELS_DICT[model_name] = model
elif max_context_length != _GLOBAL_MODELS_DICT[model_name].max_seq_length: