{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "39f9cab2-f3fb-467f-be10-0dcac737343e",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/bu/Desktop/nepali-finetune/.venv/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
}
],
"source": [
"from test_tts import load_engine, synthesize, save_wav, REPO_ROOT\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ff1757c1-52ef-4769-919a-5405fb92bd04",
"metadata": {},
"outputs": [],
"source": [
"engine = load_engine()\n"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "4d9e9f75",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Sampling: 11%|█████▍ | 111/1000 [00:01<00:12, 71.33it/s]WARNING:src.chatterbox_.models.t3.inference.alignment_stream_analyzer:forcing EOS token, long_tail=tensor(True), alignment_repetition=tensor(False), token_repetition=False\n",
"Sampling: 12%|█████▋ | 116/1000 [00:01<00:12, 71.16it/s]\n",
"Sampling: 17%|████████▏ | 167/1000 [00:02<00:11, 71.28it/s]WARNING:src.chatterbox_.models.t3.inference.alignment_stream_analyzer:🚨 Detected 2x repetition of token 4299\n",
"WARNING:src.chatterbox_.models.t3.inference.alignment_stream_analyzer:forcing EOS token, long_tail=tensor(False), alignment_repetition=tensor(False), token_repetition=True\n",
"Sampling: 17%|████████▍ | 173/1000 [00:02<00:11, 71.15it/s]\n",
"Sampling: 14%|██████▋ | 137/1000 [00:01<00:12, 70.49it/s]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Saved /home/bu/Desktop/nepali-finetune/test_output2.wav (17.47s)\n"
]
}
],
"source": [
"demo_text = (\n",
" \"\"\"\n",
" No one should be elected to a term that puts them past the age of 70 imo. I believe it's immoral for those in their later years to make decisions that only impact those younger than them.\n",
"\n",
"It's a recent phenomenon that the elderly are those in the driver's seat and it needs to stop.\n",
"\"\"\"\n",
")\n",
"sr, audio = synthesize(engine, demo_text, seed=42)\n",
"out_path = save_wav(REPO_ROOT / \"test_output2.wav\", sr, audio)\n",
"print(f\"Saved {out_path} ({len(audio) / sr:.2f}s)\")\n"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "815dd43b",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" \n",
" "
],
"text/plain": [
""
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Listen inline\n",
"import IPython.display as ipd\n",
"ipd.Audio(audio, rate=sr)\n"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "b541979b-aad1-4cbc-a3fc-efe0cd58d9ea",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" \n",
" "
],
"text/plain": [
""
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Listen inline\n",
"import IPython.display as ipd\n",
"ipd.Audio(audio, rate=sr)\n"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "a57c9a50",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Sampling: 45%|█████████████████████▉ | 448/1000 [00:06<00:08, 68.58it/s]WARNING:src.chatterbox_.models.t3.inference.alignment_stream_analyzer:🚨 Detected 2x repetition of token 4299\n",
"WARNING:src.chatterbox_.models.t3.inference.alignment_stream_analyzer:forcing EOS token, long_tail=tensor(False), alignment_repetition=tensor(False), token_repetition=True\n",
"Sampling: 45%|██████████████████████ | 450/1000 [00:06<00:07, 69.36it/s]\n",
"Sampling: 26%|████████████▍ | 255/1000 [00:03<00:10, 69.84it/s]WARNING:src.chatterbox_.models.t3.inference.alignment_stream_analyzer:🚨 Detected 2x repetition of token 4299\n",
"WARNING:src.chatterbox_.models.t3.inference.alignment_stream_analyzer:forcing EOS token, long_tail=tensor(False), alignment_repetition=tensor(False), token_repetition=True\n",
"Sampling: 26%|████████████▊ | 261/1000 [00:03<00:10, 69.25it/s]\n",
"Sampling: 22%|██████████▊ | 220/1000 [00:03<00:11, 69.81it/s]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Saved /home/bu/Desktop/nepali-finetune/test_Newari_dialect.wav (37.60s)\n"
]
},
{
"data": {
"text/html": [
"\n",
" \n",
" "
],
"text/plain": [
""
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\n",
"demo_text = (\n",
" \"\"\"\n",
" जिं छम्ह व्यक्तिया रुपय् इपिंलिसे छुं नं मुद्दा मदु, जिमि पासापिंलिसे बांलाःगु ई छ्यायेगु योजना दयेकेगु तसकं निराशाजनक जक खः, अले अन्तय् स्पेयर ह्वीलया रुपय् क्वचाइ छाय्धाःसा इपिं फुक्कसिनं थः गर्लफ्रेण्डयात नापं हयेगु निर्णय याइ । जितः थ्व मयः धकाः जिं सचेत जुयाच्वना, तर थ्व ३–१ खः अले इमिसं न्ह्याबलें बचं बियाच्वनी कि मेगु इलय् जिपिं जक जुइ । थःथःगु सवाः फरक फरक जूसां नं थःत समायोजन यायेत यात्राया मुक्कं उद्देश्य हिलेगु निर्णय यात व रमाइलो म्हो जुल ।\n",
"\"\"\"\n",
")\n",
"sr, audio = synthesize(engine, demo_text, seed=42)\n",
"out_path = save_wav(REPO_ROOT / \"test_Newari_dialect.wav\", sr, audio)\n",
"print(f\"Saved {out_path} ({len(audio) / sr:.2f}s)\")\n",
"\n",
"import IPython.display as ipd\n",
"ipd.Audio(audio, rate=sr)\n",
"\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Nepali Finetune",
"language": "python",
"name": "nepali-finetune"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}