提交 2a455fa6 编写于 作者: H Hui Zhang

fix rtf bug

上级 d95b0cd9
...@@ -33,8 +33,9 @@ if __name__ == '__main__': ...@@ -33,8 +33,9 @@ if __name__ == '__main__':
P = 0.0 P = 0.0
n = 0 n = 0
for m in rtfs: for m in rtfs:
# not accurate, may have duplicate log
n += 1 n += 1
T += m['T'] T += m['T']
P += m['P'] P += m['P']
print(f"RTF: {P/T}, utts: {n}") print(f"RTF: {P/T}")
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
import argparse import argparse
import asyncio import asyncio
import codecs import codecs
import logging
import os import os
from paddlespeech.cli.log import logger from paddlespeech.cli.log import logger
...@@ -44,7 +43,7 @@ def main(args): ...@@ -44,7 +43,7 @@ def main(args):
# support to process batch audios from wav.scp # support to process batch audios from wav.scp
if args.wavscp and os.path.exists(args.wavscp): if args.wavscp and os.path.exists(args.wavscp):
logging.info(f"start to process the wavscp: {args.wavscp}") logger.info(f"start to process the wavscp: {args.wavscp}")
with codecs.open(args.wavscp, 'r', encoding='utf-8') as f,\ with codecs.open(args.wavscp, 'r', encoding='utf-8') as f,\
codecs.open("result.txt", 'w', encoding='utf-8') as w: codecs.open("result.txt", 'w', encoding='utf-8') as w:
for line in f: for line in f:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册