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

train_model model load repaired #21

Open
JornyWan opened this issue Oct 25, 2023 · 4 comments
Open

train_model model load repaired #21

JornyWan opened this issue Oct 25, 2023 · 4 comments

Comments

@JornyWan
Copy link

In the code train_model.py:
model = AutoModelForSeq2SeqLM.from_pretrained(
model_args.model_name_or_path,
from_tf=bool(".ckpt" in model_args.model_name_or_path),
config=config,
cache_dir=model_args.cache_dir,
revision=model_args.model_revision,
use_auth_token=True if model_args.use_auth_token else None,
)
if anyone could not use this to initial a flan-t5 model from AutoModelForSeq2SeqLM, then you need to add the following in params:
unk_token="",
bos_token="",
eos_token="
"
Thanks!

@SivilTaram
Copy link
Collaborator

@JornyWan Thanks for your feedback and pull request! May I know your transformers version? I have never encountered the problem, not sure if it is the case for the latest transformers library.

@JornyWan
Copy link
Author

@SivilTaram thanks for quick response, my transformer version is 4.31.0

@JornyWan
Copy link
Author

actually it would be like:
image

@JornyWan
Copy link
Author

@SivilTaram you can just put it to another branch for different version of transformer use if it is the problem with version

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

2 participants