Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: expected scalar type ComplexDouble but found ComplexHalf[BUG:API] #107

Closed
3 tasks done
panpan123456 opened this issue Jul 16, 2024 · 2 comments
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@panpan123456
Copy link

阅读 README.md 和 dependencies.md

  • 我已经阅读过 README.md 和 dependencies.md 文件

检索 issue 和 discussion

  • 我已经确认之前没有 issue 或 discussion 涉及此 BUG

检查 Forge 版本

  • 我已经确认问题发生在最新代码或稳定版本中

Forge Commit 或者 Tag

1

Python 版本

3.11

PyTorch 版本

2.3.1

操作系统信息

macox

BUG 描述

    with torch.no_grad():

        if not skip_refine_text:
            refined = self.instance._refine_text(
                text,
                self.instance.device,
                params_refine_text,
            )
            text_tokens = refined.ids
            text_tokens = [
                i[i.less(self.instance.tokenizer_break_0_ids)] for i in text_tokens
            ]
            text = self.get_tokenizer().batch_decode(text_tokens)
            refined.destroy()
            if refine_text_only:
                yield text
                return
        if not smooth_decoding:
            length = [0 for _ in range(len(text))]
            for result in self.instance._infer_code(
                text,
                stream,
                self.instance.device,
                use_decoder,
                params_infer_code,
            ):
                wavs = self._decode_to_wavs(result, length, use_decoder)
                yield wavs

代码运行到这里会报错:
RuntimeError: expected scalar type ComplexDouble but found ComplexHalf

BUG 端点

tts_to_audio/tts_stream

复现参数

{
"text": "这是一个很有意思的事情",
"speaker_wav": "3d40607bf216486fb508758fa67f1a83",
"language": "zh"
}

期望结果

返回音频

实际结果

报错

错误信息

File "/Users/panhong/miniconda3/envs/ChatTTS_colab/lib/python3.11/site-packages/vocos/spectral_ops.py", line 46, in forward
    return torch.istft(spec, self.n_fft, self.hop_length, self.win_length, self.window, center=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: expected scalar type ComplexDouble but found ComplexHalf
@panpan123456 panpan123456 added the bug Something isn't working label Jul 16, 2024
@zhzLuke96
Copy link
Member

试试启动时带上 --no_half 参数吧,目前mps的适配不是很好,可能没法支持半精度(默认半精度)

@panpan123456
Copy link
Author

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants