selected index k out of range when attempting to gen more than 2 candidates #406

Closed
opened 2023-10-10 10:20:31 +00:00 by SyntheticVoices · 1 comment
Traceback (most recent call last):
  File "H:\ai-voice-cloning\venv\lib\site-packages\gradio\routes.py", line 394, in run_predict
    output = await app.get_blocks().process_api(
  File "H:\ai-voice-cloning\venv\lib\site-packages\gradio\blocks.py", line 1075, in process_api
    result = await self.call_function(
  File "H:\ai-voice-cloning\venv\lib\site-packages\gradio\blocks.py", line 884, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "H:\ai-voice-cloning\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "H:\ai-voice-cloning\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "H:\ai-voice-cloning\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "H:\ai-voice-cloning\venv\lib\site-packages\gradio\helpers.py", line 587, in tracked_fn
    response = fn(*args)
  File "H:\ai-voice-cloning\src\webui.py", line 94, in generate_proxy
    raise e
  File "H:\ai-voice-cloning\src\webui.py", line 88, in generate_proxy
    sample, outputs, stats = generate(**kwargs)
  File "H:\ai-voice-cloning\src\utils.py", line 351, in generate
    return generate_tortoise(**kwargs)
  File "H:\ai-voice-cloning\src\utils.py", line 1211, in generate_tortoise
    gen, additionals = tts.tts(cut_text, **settings )
  File "H:\ai-voice-cloning\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "H:\ai-voice-cloning\modules\tortoise-tts\tortoise\api.py", line 818, in tts
    best_results = samples[torch.topk(clip_results, k=k).indices]
RuntimeError: selected index k out of range

Not sure why I've never been able to generate more than 2 samples at a time. I always get this error.

image

image

``` Traceback (most recent call last): File "H:\ai-voice-cloning\venv\lib\site-packages\gradio\routes.py", line 394, in run_predict output = await app.get_blocks().process_api( File "H:\ai-voice-cloning\venv\lib\site-packages\gradio\blocks.py", line 1075, in process_api result = await self.call_function( File "H:\ai-voice-cloning\venv\lib\site-packages\gradio\blocks.py", line 884, in call_function prediction = await anyio.to_thread.run_sync( File "H:\ai-voice-cloning\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "H:\ai-voice-cloning\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "H:\ai-voice-cloning\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run result = context.run(func, *args) File "H:\ai-voice-cloning\venv\lib\site-packages\gradio\helpers.py", line 587, in tracked_fn response = fn(*args) File "H:\ai-voice-cloning\src\webui.py", line 94, in generate_proxy raise e File "H:\ai-voice-cloning\src\webui.py", line 88, in generate_proxy sample, outputs, stats = generate(**kwargs) File "H:\ai-voice-cloning\src\utils.py", line 351, in generate return generate_tortoise(**kwargs) File "H:\ai-voice-cloning\src\utils.py", line 1211, in generate_tortoise gen, additionals = tts.tts(cut_text, **settings ) File "H:\ai-voice-cloning\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) File "H:\ai-voice-cloning\modules\tortoise-tts\tortoise\api.py", line 818, in tts best_results = samples[torch.topk(clip_results, k=k).indices] RuntimeError: selected index k out of range ``` Not sure why I've never been able to generate more than 2 samples at a time. I always get this error. ![image](/attachments/046c5b18-18a6-475b-9106-c27b0dd426b3) ![image](/attachments/b0414249-7b32-4c6e-a802-6e0b2e5089f0)
125 KiB
145 KiB
Owner

I remember it working in the past, but the only thing that comes to mind is if you have Unsqueeze Sample Batches checked, it might botch some things.


After spot-checking the code, it shouldn't be having that issue. It's rather silly if it's from candidates >= sample size, so I pushed a possible (untested) fix.

I remember it working in the past, but the only thing that comes to mind is if you have `Unsqueeze Sample Batches` checked, it might botch some things. --- After spot-checking the code, it shouldn't be having that issue. It's rather silly if it's from candidates >= sample size, so I pushed a possible (untested) fix.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mrq/ai-voice-cloning#406
No description provided.