mirror of
https://github.com/SWivid/F5-TTS.git
synced 2026-03-12 21:02:50 -07:00
add tqdm in convert text to pinyin
This commit is contained in:
@@ -92,7 +92,11 @@ def process_audio_file(audio_path, text, polyphone):
|
|||||||
def batch_convert_texts(texts, polyphone, batch_size=BATCH_SIZE):
|
def batch_convert_texts(texts, polyphone, batch_size=BATCH_SIZE):
|
||||||
"""Convert a list of texts to pinyin in batches."""
|
"""Convert a list of texts to pinyin in batches."""
|
||||||
converted_texts = []
|
converted_texts = []
|
||||||
for i in range(0, len(texts), batch_size):
|
for i in tqdm(
|
||||||
|
range(0, len(texts), batch_size),
|
||||||
|
total=(len(texts) + batch_size - 1) // batch_size,
|
||||||
|
desc="Converting texts to pinyin",
|
||||||
|
):
|
||||||
batch = texts[i : i + batch_size]
|
batch = texts[i : i + batch_size]
|
||||||
converted_batch = convert_char_to_pinyin(batch, polyphone=polyphone)
|
converted_batch = convert_char_to_pinyin(batch, polyphone=polyphone)
|
||||||
converted_texts.extend(converted_batch)
|
converted_texts.extend(converted_batch)
|
||||||
|
|||||||
Reference in New Issue
Block a user