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

Add special_token #204

Open
chenzebiaohub opened this issue Apr 19, 2024 · 0 comments
Open

Add special_token #204

chenzebiaohub opened this issue Apr 19, 2024 · 0 comments

Comments

@chenzebiaohub
Copy link

chenzebiaohub commented Apr 19, 2024

# special_tokens_dict = {'additional_special_tokens': ['<ENTITY>', '<DESCRIPTION>']}
# tokenizer.add_special_tokens(special_tokens_dict)
# 模型加载
# model = AutoModelForSeq2SeqLM.from_pretrained(conf.model_folder, trust_remote_code=True)
**# model.resize_token_embeddings(len(tokenizer))  # 关键步骤,重新调整所有的向量数量,即vocab size**
# tokenizer.save_pretrained(conf.output_path)

报错resize_token_embeddings
[PyTroch报错NotImplementedError]

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

No branches or pull requests

1 participant