Skip to content
Snippets Groups Projects
Commit b8301282 authored by kulcsar's avatar kulcsar
Browse files

change stuff in train

parent 3ae9723a
No related branches found
No related tags found
No related merge requests found
......@@ -50,39 +50,39 @@ def train(model, name, seed,gradient_accumulation_steps,mixup, threshold, lambda
index=0
for batch in train_dataloader:
if model.name_or_path == "":
if epoch == mixepoch:
inputs={'input_ids': batch[0],
'attention_mask': batch[1],
'token_type_ids': batch[2],
'start_position': batch[3],
'end_position': batch[4],
'labels': batch[5],
'mixepoch': True,
'mixlayer':mixepoch,
'lambda_value':lambda_value}
else:
inputs={'input_ids': batch[0],
'attention_mask': batch[1],
'token_type_ids': batch[2],
'start_position': batch[3],
'end_position': batch[4],
'labels': batch[5],
'mixepoch': False,
'mixlayer':mixepoch,
'lambda_value':lambda_value}
if model.name_or_path[0] == "b":
inputs = {'input_ids': batch[0],
'attention_mask': batch[1],
'token_type_ids': batch[2],
'start_position': batch[3],
'end_position': batch[4],
'labels': batch[5]}
labels=batch[5]
start_positions=batch[3]
end_positions=batch[4]
if model.name_or_path[0] == "r":
if name[0] == "b":
if tmix==False:
inputs = {'input_ids': batch[0],
'attention_mask': batch[1],
'token_type_ids': batch[2],
'start_position': batch[3],
'end_position': batch[4],
'labels': batch[5]}
labels=batch[5]
start_positions=batch[3]
end_positions=batch[4]
if tmix==True:
if epoch == mixepoch:
inputs={'input_ids': batch[0],
'attention_mask': batch[1],
'token_type_ids': batch[2],
'start_position': batch[3],
'end_position': batch[4],
'labels': batch[5],
'mixepoch': True,
'mixlayer':mixepoch,
'lambda_value':lambda_value}
else:
inputs={'input_ids': batch[0],
'attention_mask': batch[1],
'token_type_ids': batch[2],
'start_position': batch[3],
'end_position': batch[4],
'labels': batch[5],
'mixepoch': False,
'mixlayer':mixepoch,
'lambda_value':lambda_value}
if name[0] == "r":
inputs = {'input_ids': batch[0],
'attention_mask': batch[1],
'start_position': batch[2],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment