Skip to content

RuntimeError: narrow(): length must be non-negative. #955

@jihui100

Description

@jihui100

main分支和dev分支都会出现下面的问题。

text: 0%|▏ | 1/384(max) [00:00, 5.46it/s]Traceback (most recent call last):
File "/home/ubuntu/code/ChatTTS/r.py", line 16, in
wavs = chat.infer(texts, use_decoder=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/code/ChatTTS/ChatTTS/core.py", line 263, in infer
for wavs in res_gen:
File "/home/ubuntu/code/ChatTTS/ChatTTS/core.py", line 420, in _infer
refined = self._refine_text(
^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/miniconda3/envs/chattts/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/code/ChatTTS/ChatTTS/core.py", line 730, in _refine_text
result = next(
^^^^^
File "/home/ubuntu/miniconda3/envs/chattts/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 36, in generator_context
response = gen.send(None)
^^^^^^^^^^^^^^
File "/home/ubuntu/code/ChatTTS/ChatTTS/model/gpt.py", line 396, in generate
model_input = self._prepare_generation_inputs(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/miniconda3/envs/chattts/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/code/ChatTTS/ChatTTS/model/gpt.py", line 230, in _prepare_generation_inputs
attention_mask = attention_mask.narrow(
^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: narrow(): length must be non-negative.
text: 0%|▏ | 1/384(max) [00:00, 3.47it/s]
(chattts) ubuntu@ubuntu-server:~/code/ChatTTS$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions