Update lm_finetuning.py
Browse files- lm_finetuning.py +1 -10
lm_finetuning.py
CHANGED
@@ -211,16 +211,7 @@ def main():
|
|
211 |
),
|
212 |
train_dataset=tokenized_datasets[opt.split_train],
|
213 |
eval_dataset=tokenized_datasets[opt.split_test],
|
214 |
-
compute_metrics=compute_metric_all
|
215 |
-
model_init=lambda x: AutoModelForSequenceClassification.from_pretrained(
|
216 |
-
opt.model,
|
217 |
-
return_dict=True,
|
218 |
-
num_labels=len(dataset[opt.split_train]['label'][0]),
|
219 |
-
local_files_only=not network,
|
220 |
-
problem_type="multi_label_classification",
|
221 |
-
id2label=ID2LABEL,
|
222 |
-
label2id=LABEL2ID
|
223 |
-
)
|
224 |
)
|
225 |
summary_file = pj(opt.output_dir, opt.summary_file)
|
226 |
if not opt.skip_eval:
|
|
|
211 |
),
|
212 |
train_dataset=tokenized_datasets[opt.split_train],
|
213 |
eval_dataset=tokenized_datasets[opt.split_test],
|
214 |
+
compute_metrics=compute_metric_all
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
)
|
216 |
summary_file = pj(opt.output_dir, opt.summary_file)
|
217 |
if not opt.skip_eval:
|