Skip to content

Commit

Permalink
remove dead code. This fixes #5
Browse files Browse the repository at this point in the history
  • Loading branch information
shashwat1002 committed Aug 15, 2022
1 parent b869b2e commit 5ac9a15
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from transformers.optimization import AdamW, WarmupLinearSchedule
from transformers.log_utils import AverageMeter
import dist_comms
from validation import validate
# from validation import validate



Expand Down Expand Up @@ -620,10 +620,11 @@ def pos_inf_train_gen():
optimizer.zero_grad()
global_step += 1
if n_gpu > 1 and args.local_rank == -1 or (n_gpu <=1 and args.local_rank == 0):
if False and (step + 1) % 100 == 0:
neg_valid_res = validate(model=model, dataloader=neg_valid_dataloader, device=device, negated=True)
pos_valid_res = validate(model=model, dataloader=pos_valid_dataloader, device=device, negated=False)
wandb.log({'neg/valid/p@1': neg_valid_res % 100., 'pos/valid/p@1': pos_valid_res % 100.})
# if False and (step + 1) % 100 == 0:
# neg_valid_res = validate(model=model, dataloader=neg_valid_dataloader, device=device, negated=True)
# pos_valid_res = validate(model=model, dataloader=pos_valid_dataloader, device=device, negated=False)
# wandb.log({'neg/valid/p@1': neg_valid_res % 100., 'pos/valid/p@1': pos_valid_res % 100.})
pass

# Save a trained model
if n_gpu > 1 and args.local_rank == -1 or (n_gpu <=1 and args.local_rank == 0):
Expand Down

0 comments on commit 5ac9a15

Please sign in to comment.