Skip to content

Commit

Permalink
fixed none working trust_remote_code config
Browse files Browse the repository at this point in the history
  • Loading branch information
baptistecolle committed Aug 6, 2024
1 parent 626f613 commit 104feb2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions llm_perf/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
# model for model in PRETRAINED_OPEN_LLM_LIST if model.split("/")[0] in CANONICAL_ORGANIZATIONS
# ]
CANONICAL_PRETRAINED_OPEN_LLM_LIST = [
"01-ai/Yi-6B",
"01-ai/Yi-34B",
# "01-ai/Yi-6B",
# "01-ai/Yi-34B",
"Deci/DeciLM-7B",
"Deci/DeciCoder-1b",
"EleutherAI/gpt-j-6b",
Expand Down
1 change: 1 addition & 0 deletions optimum_benchmark/backends/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def __post_init__(self):
self.library,
revision=self.model_kwargs.get("revision", None),
token=self.model_kwargs.get("token", None),
trust_remote_code=self.model_kwargs.get("trust_remote_code", False),
)

if self.device is None:
Expand Down
5 changes: 4 additions & 1 deletion optimum_benchmark/task_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ def infer_model_type_from_model_name_or_path(
library_name: Optional[str] = None,
revision: Optional[str] = None,
token: Optional[str] = None,
trust_remote_code: bool = False,
) -> str:
if library_name is None:
library_name = infer_library_from_model_name_or_path(model_name_or_path, revision=revision, token=token)
Expand All @@ -216,7 +217,9 @@ def infer_model_type_from_model_name_or_path(
break

else:
transformers_config = get_transformers_pretrained_config(model_name_or_path, revision=revision, token=token)
transformers_config = get_transformers_pretrained_config(
model_name_or_path, revision=revision, token=token, trust_remote_code=trust_remote_code
)
inferred_model_type = transformers_config.model_type

if inferred_model_type is None:
Expand Down

0 comments on commit 104feb2

Please sign in to comment.