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

Support models that require trust_remote_code #357

Open
neubig opened this issue Sep 21, 2023 · 1 comment
Open

Support models that require trust_remote_code #357

neubig opened this issue Sep 21, 2023 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@neubig
Copy link
Collaborator

neubig commented Sep 21, 2023

Some recent models require Hugging Face's trust_remote_code to be set to true. This should be off by default, but we should allow users to set it if they wish. Reference: #356

In order to implement this, trust_remote_code will probably need to be set when we load the model here:

if self.has_encoder:
self.model = transformers.AutoModelForSeq2SeqLM.from_pretrained(
pretrained_model_name
)
self.tokenizer = transformers.AutoTokenizer.from_pretrained(
pretrained_model_name
)
else:
self.model = transformers.AutoModelForCausalLM.from_pretrained(
pretrained_model_name
)
self.tokenizer = transformers.AutoTokenizer.from_pretrained(
pretrained_model_name, padding_side="left"
)

This should be set as an argument to GenerationModelTrainer with a default of false:

@imdevtej
Copy link

I Will do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants