Skip to content

Commit

Permalink
Also try to load a 'dynamic module' if not trust-remote, but local model
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaarsen committed Dec 4, 2024
1 parent 8a9e5dc commit 294fec6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sentence_transformers/SentenceTransformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,7 @@ def _load_module_class_from_ref(
if class_ref.startswith("sentence_transformers."):
return import_from_string(class_ref)

if trust_remote_code:
if trust_remote_code or os.path.exists(model_name_or_path):
code_revision = model_kwargs.pop("code_revision", None) if model_kwargs else None
try:
return get_class_from_dynamic_module(
Expand Down

0 comments on commit 294fec6

Please sign in to comment.