Show total training time
This commit is contained in:
parent
2ea8000657
commit
fda7f7ed5f
|
@ -1,7 +1,8 @@
|
||||||
from asyncio import run
|
from asyncio import run
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
from time import time
|
||||||
|
|
||||||
from model import infer_sequence, train_model
|
from locimend.model import infer_sequence, train_model
|
||||||
|
|
||||||
|
|
||||||
def parse_arguments() -> Namespace:
|
def parse_arguments() -> Namespace:
|
||||||
|
@ -21,7 +22,10 @@ def parse_arguments() -> Namespace:
|
||||||
|
|
||||||
async def execute_task(args):
|
async def execute_task(args):
|
||||||
if args.task == "train":
|
if args.task == "train":
|
||||||
|
start_time = time()
|
||||||
train_model(data_file=args.data_file, label_file=args.label_file)
|
train_model(data_file=args.data_file, label_file=args.label_file)
|
||||||
|
end_time = time()
|
||||||
|
print(f"Training time: {end_time - start_time}")
|
||||||
else:
|
else:
|
||||||
prediction = await infer_sequence(sequence=args.sequence)
|
prediction = await infer_sequence(sequence=args.sequence)
|
||||||
print(f"Error-corrected sequence: {prediction}")
|
print(f"Error-corrected sequence: {prediction}")
|
||||||
|
|
Loading…
Reference in New Issue