-
Notifications
You must be signed in to change notification settings - Fork 33
[bugfix] Let trust_remote_code take effect #226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,7 +118,7 @@ def _calc_perf_data( | |
| model_cfg: Model configuration | ||
| perf_datas: Raw performance data | ||
| """ | ||
| tokenizer = AISTokenizer(model_cfg.get("path")) | ||
| tokenizer = AISTokenizer(model_cfg.get("path"), model_cfg.get("trust_remote_code", False)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In |
||
| conn = init_db(db_file_path) | ||
| all_numpy_data = load_all_numpy_from_db(conn) | ||
|
|
||
|
|
@@ -256,7 +256,7 @@ def _load_details_perf_data(self, model_cfg: dict, dataset_group: list): | |
| details_perf_datas = defaultdict(list) | ||
|
|
||
| # check tokenizer | ||
| load_tokenizer(tokenizer_path=model_cfg.get("path")) | ||
| load_tokenizer(tokenizer_path=model_cfg.get("path"), trust_remote_code=model_cfg.get("trust_remote_code", False)) | ||
|
|
||
| with multiprocessing.Manager() as manager: | ||
| manager_list = manager.list() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic
config.get("TrustRemoteCode") or kwargs.get("trust_remote_code", False)might lead to unexpected behavior ifTrustRemoteCodeis explicitly set toFalsein the config buttrust_remote_codeisTrueinkwargs. While the comment says "Any place set True will take effect", usingorwill ignore an explicitFalsefrom the first source. A more robust way to handle this, if you want to prioritize one or ensure an explicit boolean is respected, would be to check forNonespecifically.