2023-08-02 21:53:35 +00:00
|
|
|
import argparse
|
|
|
|
|
|
|
|
import torch
|
|
|
|
|
|
|
|
from .data import get_phone_symmap
|
2023-10-09 20:24:04 +00:00
|
|
|
from .engines import load_engines
|
2023-08-14 03:56:28 +00:00
|
|
|
from .config import cfg
|
2023-08-02 21:53:35 +00:00
|
|
|
|
|
|
|
def main():
|
|
|
|
parser = argparse.ArgumentParser("Save trained model to path.")
|
2023-08-20 18:42:18 +00:00
|
|
|
parser.add_argument("--module-only", action='store_true')
|
2023-08-02 21:53:35 +00:00
|
|
|
args = parser.parse_args()
|
|
|
|
|
2023-08-20 18:42:18 +00:00
|
|
|
if args.module_only:
|
|
|
|
cfg.trainer.load_module_only = True
|
|
|
|
|
2023-08-14 03:56:28 +00:00
|
|
|
engines = load_engines()
|
2023-08-20 18:39:58 +00:00
|
|
|
engines.export(userdata={"symmap": get_phone_symmap()})
|
2023-08-02 21:53:35 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|