Skip to content

Commit e3cdbd9

Browse files
committed
Pass trust_remote_code to sentence transformers export
1 parent 45c1c09 commit e3cdbd9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

optimum/exporters/tasks.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1810,8 +1810,9 @@ def get_model_from_task(
18101810
elif library_name == "sentence_transformers":
18111811
cache_folder = model_kwargs.pop("cache_folder", None)
18121812
use_auth_token = model_kwargs.pop("use_auth_token", None)
1813+
trust_remote_code = model_kwargs.pop("trust_remote_code", False)
18131814
model = model_class(
1814-
model_name_or_path, device=device, cache_folder=cache_folder, use_auth_token=use_auth_token
1815+
model_name_or_path, device=device, cache_folder=cache_folder, use_auth_token=use_auth_token, trust_remote_code=trust_remote_code,
18151816
)
18161817
else:
18171818
try:

0 commit comments

Comments
 (0)