Last active
June 6, 2020 08:08
-
-
Save andreaschandra/0b0d67a04cd336a1b8dac21893d01fbc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_model(args, num_labels): | |
config = AutoConfig.from_pretrained( | |
args.model_name_or_path, | |
num_labels=num_labels, | |
finetuning_task=args.task_name, | |
) | |
tokenizer = AutoTokenizer.from_pretrained( | |
args.model_name_or_path, | |
do_lower_case=args.do_lower_case | |
) | |
model = AutoModelForSequenceClassification.from_config( | |
config | |
) | |
return config, tokenizer, model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment