Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

train.py 913 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  1. #!/usr/bin/env python3 -u
  2. # Copyright (c) 2017-present, Facebook, Inc.
  3. # All rights reserved.
  4. #
  5. # This source code is licensed under the license found in the LICENSE file in
  6. # the root directory of this source tree. An additional grant of patent rights
  7. # can be found in the PATENTS file in the same directory.
  8. from fairseq import options
  9. from distributed_train import main as distributed_main
  10. from multiprocessing_train import main as multiprocessing_main
  11. from singleprocess_train import main as singleprocess_main
  12. def main(args):
  13. if args.distributed_port > 0 \
  14. or args.distributed_init_method is not None:
  15. distributed_main(args)
  16. elif args.distributed_world_size > 1:
  17. multiprocessing_main(args)
  18. else:
  19. singleprocess_main(args)
  20. if __name__ == '__main__':
  21. parser = options.get_training_parser()
  22. args = options.parse_args_and_arch(parser)
  23. main(args)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...