Skip to content
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

Merged
merged 7 commits into from
Dec 26, 2023

Conversation

CrazyBoyM
Copy link

单测时需要设置aistudio的token,

export AISTUDIO_ACCESS_TOKEN="XXX"

@@ -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", "")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这为啥不能用pop呢

Copy link
Author

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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

后续需要等aistuio修改一下cache dir

Copy link
Owner

@JunnYu JunnYu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JunnYu JunnYu merged commit a376387 into JunnYu:support_subfolder Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants