-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathtrain.py
More file actions
executable file
·27 lines (23 loc) · 763 Bytes
/
Copy pathtrain.py
File metadata and controls
executable file
·27 lines (23 loc) · 763 Bytes
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
from .model.model import Punctuator
from .data.data import TRAIN_FILE
from .data.data import load
from .model.config import Config
import os
def main():
config = Config()
# build model
print("Building model...")
"""
if resuming training then pass resume_training=True. Resumes from the last saved model.
But make sure the ckpt folder has saved the models.
"""
punctuator = Punctuator(config)
print("Loading dataset...")
train_set = load(TRAIN_FILE)
ref = os.path.join('.', 'data', 'raw', 'ref.txt')
asr = os.path.join('.', 'data', 'raw', 'asr.txt')
print("Training mode...")
texts = [ref, asr]
punctuator.train(train_set, batch_size=32, epochs=30, texts=texts)
if __name__ == '__main__':
main()