zyf0278 commited on
Commit
acd0349
·
1 Parent(s): 331a0c7

upload test-to-code model

Browse files
Files changed (27) hide show
  1. Text-code/text-to-code/code/eval.sh +1 -1
  2. Text-code/text-to-code/code/evaluate.sh +3 -0
  3. Text-code/text-to-code/code/run.py +8 -0
  4. Text-code/text-to-code/data.zip +2 -2
  5. Text-code/text-to-code/model/epoch_1/subject_model.pth +3 -0
  6. Text-code/text-to-code/model/epoch_10/subject_model.pth +3 -0
  7. Text-code/text-to-code/model/epoch_11/subject_model.pth +3 -0
  8. Text-code/text-to-code/model/epoch_12/subject_model.pth +3 -0
  9. Text-code/text-to-code/model/epoch_13/subject_model.pth +3 -0
  10. Text-code/text-to-code/model/epoch_14/subject_model.pth +3 -0
  11. Text-code/text-to-code/model/epoch_15/subject_model.pth +3 -0
  12. Text-code/text-to-code/model/epoch_16/subject_model.pth +3 -0
  13. Text-code/text-to-code/model/epoch_17/subject_model.pth +3 -0
  14. Text-code/text-to-code/model/epoch_18/subject_model.pth +3 -0
  15. Text-code/text-to-code/model/epoch_19/subject_model.pth +3 -0
  16. Text-code/text-to-code/model/epoch_2/subject_model.pth +3 -0
  17. Text-code/text-to-code/model/epoch_20/subject_model.pth +3 -0
  18. Text-code/text-to-code/model/epoch_21/subject_model.pth +3 -0
  19. Text-code/text-to-code/model/epoch_22/subject_model.pth +3 -0
  20. Text-code/text-to-code/model/epoch_23/subject_model.pth +3 -0
  21. Text-code/text-to-code/model/epoch_3/subject_model.pth +3 -0
  22. Text-code/text-to-code/model/epoch_4/subject_model.pth +3 -0
  23. Text-code/text-to-code/model/epoch_5/subject_model.pth +3 -0
  24. Text-code/text-to-code/model/epoch_6/subject_model.pth +3 -0
  25. Text-code/text-to-code/model/epoch_7/subject_model.pth +3 -0
  26. Text-code/text-to-code/model/epoch_8/subject_model.pth +3 -0
  27. Text-code/text-to-code/model/epoch_9/subject_model.pth +3 -0
Text-code/text-to-code/code/eval.sh CHANGED
@@ -4,7 +4,7 @@ OUTPUTDIR=../model
4
  PRETRAINDIR=../model/checkpoint-last
5
  LOGFILE=text2code_concode_eval.log
6
 
7
- CUDA_VISIBLE_DEVICES=2 python run.py \
8
  --data_dir=$DATADIR \
9
  --langs=$LANG \
10
  --output_dir=$OUTPUTDIR \
 
4
  PRETRAINDIR=../model/checkpoint-last
5
  LOGFILE=text2code_concode_eval.log
6
 
7
+ CUDA_VISIBLE_DEVICES=0 python run.py \
8
  --data_dir=$DATADIR \
9
  --langs=$LANG \
10
  --output_dir=$OUTPUTDIR \
Text-code/text-to-code/code/evaluate.sh ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ python evaluator.py \
2
+ -a=../dataset/dev.json \
3
+ -p=../model/dev.output
Text-code/text-to-code/code/run.py CHANGED
@@ -653,10 +653,18 @@ def main():
653
  logger.info(" global_step = %s, average loss = %s", global_step, tr_loss)
654
 
655
  if args.do_eval: # only works on 1 GPU
 
 
 
 
656
  dev_bleu, dev_EM = eval_bleu(args, model, tokenizer, file_type='dev', num=2000)
657
  logger.info(f"dev bleu: {dev_bleu}, dev EM: {dev_EM}")
658
 
659
  if args.do_infer: # only works on 1 GPU
 
 
 
 
660
  test_bleu, test_EM = eval_bleu(args, model, tokenizer, file_type='test', num=2000)
661
  logger.info(f"test bleu: {test_bleu}, test EM: {test_EM}")
662
 
 
653
  logger.info(" global_step = %s, average loss = %s", global_step, tr_loss)
654
 
655
  if args.do_eval: # only works on 1 GPU
656
+ checkpoint_prefix = 'epoch_23/subject_model.pth'
657
+ output_dir = os.path.join(args.output_dir, '{}'.format(checkpoint_prefix))
658
+ model.load_state_dict(torch.load(output_dir))
659
+ model.to(args.device)
660
  dev_bleu, dev_EM = eval_bleu(args, model, tokenizer, file_type='dev', num=2000)
661
  logger.info(f"dev bleu: {dev_bleu}, dev EM: {dev_EM}")
662
 
663
  if args.do_infer: # only works on 1 GPU
664
+ checkpoint_prefix = 'epoch_23/subject_model.pth'
665
+ output_dir = os.path.join(args.output_dir, '{}'.format(checkpoint_prefix))
666
+ model.load_state_dict(torch.load(output_dir))
667
+ model.to(args.device)
668
  test_bleu, test_EM = eval_bleu(args, model, tokenizer, file_type='test', num=2000)
669
  logger.info(f"test bleu: {test_bleu}, test EM: {test_EM}")
670
 
Text-code/text-to-code/data.zip CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:fb2b374c733f0a4d1b7e65aa063b7f1af6a38eab55fb9c26cf5c20e435934ac9
3
- size 20278219
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f18c01ec758232af7c7f68c448b6ae3d9a979099f1f7b8d56e2e525acb7bdf6b
3
+ size 20278243
Text-code/text-to-code/model/epoch_1/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ddbd9cbdacf39a519c3846b810d0167b6fbe6867f83c4306ee30a3ae255ce99c
3
+ size 497830938
Text-code/text-to-code/model/epoch_10/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3496115570c8f9d2cedbba08bdd4753a23549114f9a35245f23273732c6476f7
3
+ size 497830938
Text-code/text-to-code/model/epoch_11/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1728e8132a8bd1641d98a6f9d44097996303c30cec3e812cec41f5742f980fb3
3
+ size 497830938
Text-code/text-to-code/model/epoch_12/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a7b1c3850509915d7e84b32d3d35c4e8e260f9dfec66e495379d94af3a517237
3
+ size 497830938
Text-code/text-to-code/model/epoch_13/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7306ca9125b53388517e5c1df2c9247f0175eacb960fac682ebbdd05d980e245
3
+ size 497830938
Text-code/text-to-code/model/epoch_14/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eabf1f5543679354bcf18a8dd286eee1844578244b92a7efd4fd4e3bafa3c706
3
+ size 497830938
Text-code/text-to-code/model/epoch_15/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d67013ce61743101ddf0336b61534717ede6a6d7736499b5de88d84343be82a1
3
+ size 497830938
Text-code/text-to-code/model/epoch_16/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:adc17143a1b927a9fe2c21f6865caae2642687f610ae0912e682317517c16d37
3
+ size 497830938
Text-code/text-to-code/model/epoch_17/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7663703474145a4e75f1ef5b5db6d5829300dafda93910c928ebe165c174f1bf
3
+ size 497830938
Text-code/text-to-code/model/epoch_18/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e4892e418dfa5729e0542c1c3bf6f0d5a71f92e4ace97859407396252ed4d023
3
+ size 497830938
Text-code/text-to-code/model/epoch_19/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4a7d5b0ae5620a9244b6bd85bbc235d6a18f48593a38fee776ac702b363e1ab5
3
+ size 497830938
Text-code/text-to-code/model/epoch_2/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9502f1df54d0893c6a9fed323433d59703b895ad26ab2742b22d2cc245f2c7c0
3
+ size 497830938
Text-code/text-to-code/model/epoch_20/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c996b034d362f5bd5532085d871b5f0ff385292566be914ef2e4fe3ee4829729
3
+ size 497830938
Text-code/text-to-code/model/epoch_21/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:499c13966b621c0c2c566cb921902d623e5be124789cf18967937c02152caa79
3
+ size 497830938
Text-code/text-to-code/model/epoch_22/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f0339ad1d11b1afe2746f59e5c746e855aac827c00d6f7eb714c5e61fd0a7335
3
+ size 497830938
Text-code/text-to-code/model/epoch_23/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:abef0eb60b85c8b88f60ee22bb8b6801ebd465055e9b0687031b673c4244a68e
3
+ size 497830938
Text-code/text-to-code/model/epoch_3/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:669de5573c60387d060139fa79635eba630bfe7368d09e8aae2016a34f794c71
3
+ size 497830938
Text-code/text-to-code/model/epoch_4/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e23ff43ba8fd83705a28f04175ee1b29a0868bda82e509b48befc5ad6396f4f0
3
+ size 497830938
Text-code/text-to-code/model/epoch_5/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a094e91f0c033426b7b3ce0622b39b78a0fcbf847729714a4435c895a82415de
3
+ size 497830938
Text-code/text-to-code/model/epoch_6/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2c3559db0eb3700d0b0e7cad2551a0c9bd40c4e2ff5cdeb8bef0df816afe124f
3
+ size 497830938
Text-code/text-to-code/model/epoch_7/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c27f42d903b84e63e0bb036aa96c63d48f6dd124b228fc221841d70b898adcea
3
+ size 497830938
Text-code/text-to-code/model/epoch_8/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b27a5eebaa73a81c5081b7910e8a60415b4de0a4f0fdd25acfc60f26f917eb8d
3
+ size 497830938
Text-code/text-to-code/model/epoch_9/subject_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:617515f5345cc66199074d9f1b5b47542f1eff4ed30b40b703f9c8aa195326f8
3
+ size 497830938