optimize(test): log printing

This commit is contained in:
源文雨
2024-07-04 22:04:34 +09:00
parent a6febc876a
commit ff5d30b4fd
2 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ from tools.logger import get_logger
logger = get_logger("Test #511", lv=logging.WARN)
chat = ChatTTS.Chat(logger)
chat.load(compile=False) # Set to True for better performance
chat.load(compile=False, source="huggingface") # Set to True for better performance
texts = [
"的 话 语 音 太 短 了 会 造 成 生 成 音 频 错 误 , 这 是 占 位 占 位 , 老 大 爷 觉 得 车 夫 的 想 法 很 有 道 理 [uv_break]",
+8 -1
View File
@@ -14,7 +14,7 @@ from tools.logger import get_logger
logger = get_logger("Test #521", lv=logging.WARN)
chat = ChatTTS.Chat(logger)
chat = ChatTTS.Chat(logger, source="huggingface")
chat.load(compile=False) # Set to True for better performance
texts = [
@@ -25,6 +25,12 @@ texts = [
gen_result = chat.infer(
texts,
stream=True,
params_refine_text=ChatTTS.Chat.RefineTextParams(
show_tqdm=False,
),
params_infer_code=ChatTTS.Chat.InferCodeParams(
show_tqdm=False,
)
)
has_finished = [False for _ in range(len(texts))]
@@ -40,6 +46,7 @@ for i, result in enumerate(gen_result):
continue
if not has_finished[j]:
has_finished[j] = True
logger.warning("iter %d index %d len finished unfully", i, j)
else:
logger.warning(
"stream iter %d index %d returned non-zero wav after finished", i, j