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

Setting parameters of Trainer returned by .get_trainer() #540

Closed
Tomiinek opened this issue Nov 21, 2020 · 2 comments
Closed

Setting parameters of Trainer returned by .get_trainer() #540

Tomiinek opened this issue Nov 21, 2020 · 2 comments

Comments

@Tomiinek
Copy link

First, thank you for the current Trainer changes in #519!

I cannot figure out how to set trainer parameters when using .get_trainer(). The PR mentions an option:

trainer = tokenizer.model.get_trainer()
trainer.vocab_size = s
trainer.special_tokens = st
tokenizer.train(files, trainer=trainer)

But it does not work for me and says: AttributeError: 'WordLevelTrainer' object has no attribute 'vocab_size'

Is there a way to do this? I can use trainer = type(trainer)(vocab_size=s, special_tokens=st), but it does not seem to be the preferred way.

@n1t0
Copy link
Member

n1t0 commented Nov 23, 2020

Indeed, this is something that we are currently adding, it will be possible as soon as we merge #530

In the meantime, your workaround is necessary.

@Tomiinek
Copy link
Author

Ok, thanks!

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