Skip to content

Commit

Permalink
Update tasks.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sileod authored Nov 16, 2022
1 parent 0379d31 commit 3c655f1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/tasknet/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,16 @@ class MultipleChoice(Classification):
)

num_labels = 2

data_collator: _ = DataCollatorForMultipleChoice()
choices: _ = field(default_factory=list)
s1: str = "inputs"

def __post_init__(self):
super().__post_init__()
self.data_collator.tokenizer_kwargs = self.tokenizer_kwargs

def set_tokenizer(self, tokenizer):
self.tokenizer = tokenizer
self.data_collator = DataCollatorForMultipleChoice(
tokenizer=self.tokenizer, tokenizer_kwargs=self.tokenizer_kwargs
)
self.tokenizer = self.data_collator.tokenizer= tokenizer

def preprocess_function(self, examples):
num_choices = len(self.choices)
Expand Down

0 comments on commit 3c655f1

Please sign in to comment.