Skip to content

Commit 96c6d48

Browse files
authored
Pass trust_remote_code to sentence transformers export (#1677)
* Pass `trust_remote_code` to sentence transformers export * Run `make style`
1 parent 9201bd4 commit 96c6d48

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

optimum/exporters/tasks.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1841,8 +1841,13 @@ def get_model_from_task(
18411841
elif library_name == "sentence_transformers":
18421842
cache_folder = model_kwargs.pop("cache_folder", None)
18431843
use_auth_token = model_kwargs.pop("use_auth_token", None)
1844+
trust_remote_code = model_kwargs.pop("trust_remote_code", False)
18441845
model = model_class(
1845-
model_name_or_path, device=device, cache_folder=cache_folder, use_auth_token=use_auth_token
1846+
model_name_or_path,
1847+
device=device,
1848+
cache_folder=cache_folder,
1849+
use_auth_token=use_auth_token,
1850+
trust_remote_code=trust_remote_code,
18461851
)
18471852
else:
18481853
try:

0 commit comments

Comments
 (0)