-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix subfolder && add subfolder tests #9
Conversation
@@ -159,7 +159,7 @@ def from_pretrained(cls, pretrained_model_name_or_path: str, *model_args, **kwar | |||
config = AutoConfig.from_pretrained("bert-base-uncased") | |||
config.save_pretrained('./bert-base-uncased') | |||
""" | |||
subfolder = kwargs.pop("subfolder", "") |
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.
这为啥不能用pop呢
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.
这样会导致后续一些子函数中无法获取到kwargs中的subfolder,导致找不到正确的配置路径
@@ -1559,7 +1559,9 @@ def from_pretrained(cls, pretrained_model_name_or_path, *args, **kwargs): | |||
for k, v in resolved_vocab_files.items(): | |||
if v is not None and os.path.isfile(v): | |||
tokenizer_config_file_dir_list.add(os.path.dirname(v)) | |||
assert len(tokenizer_config_file_dir_list) == 1, "All tokenizer files should be in the same directory." | |||
tokenizer_config_file_dir_list = list(tokenizer_config_file_dir_list) | |||
# TODO: check this |
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.
后续需要等aistuio修改一下cache dir
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.
LGTM
单测时需要设置aistudio的token,