Update lm_finetuning.py
Browse files- lm_finetuning.py +6 -2
lm_finetuning.py
CHANGED
@@ -156,8 +156,12 @@ def main():
|
|
156 |
eval_dataset=tokenized_datasets[opt.split_validation],
|
157 |
compute_metrics=compute_metric_search,
|
158 |
model_init=lambda x: AutoModelForSequenceClassification.from_pretrained(
|
159 |
-
opt.model,
|
160 |
-
|
|
|
|
|
|
|
|
|
161 |
)
|
162 |
# parameter search
|
163 |
if PARALLEL:
|
|
|
156 |
eval_dataset=tokenized_datasets[opt.split_validation],
|
157 |
compute_metrics=compute_metric_search,
|
158 |
model_init=lambda x: AutoModelForSequenceClassification.from_pretrained(
|
159 |
+
opt.model,
|
160 |
+
return_dict=True,
|
161 |
+
num_labels=len(dataset[opt.split_train]['label'][0])
|
162 |
+
id2label=ID2LABEL,
|
163 |
+
label2id=LABEL2ID
|
164 |
+
)
|
165 |
)
|
166 |
# parameter search
|
167 |
if PARALLEL:
|