manmay-nakhashi / tortoise-tts-fastest

Faster Tortoise inference then Tortoise Fast Fork
GNU Affero General Public License v3.0
122 stars 9 forks source link

RuntimeError: expected scalar type Float but found Half #12

Open migueldubme opened 10 months ago

migueldubme commented 10 months ago

I´m trying to make this new version work with the script tortoise_tts.py work, but I´m getting this error, any idea what do I have to change ??

Traceback (most recent call last):
  File "/content/gdrive/Othercomputers/Mi portátil/Dubme/FastTortoise/tortoise-tts-fastest/scripts/./tortoise_tts.py", line 352, in <module>
    gen = tts.tts_with_preset(
  File "/content/tortoise-tts-fastest/tortoise/api.py", line 534, in tts_with_preset
    return self.tts(text, **settings)
  File "/content/tortoise-tts-fastest/tortoise/api.py", line 672, in tts
    codes = autoregressive.inference_speech(
  File "/content/tortoise-tts-fastest/tortoise/models/autoregressive.py", line 652, in inference_speech
    gen = self.ds_engine.module.generate(
  File "/usr/local/lib/python3.10/dist-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/transformers/generation/utils.py", line 1565, in generate
    return self.sample(
  File "/usr/local/lib/python3.10/dist-packages/transformers/generation/utils.py", line 2612, in sample
    outputs = self(
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/content/tortoise-tts-fastest/tortoise/models/autoregressive.py", line 126, in forward
    transformer_outputs = self.transformer(
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/transformers/models/gpt2/modeling_gpt2.py", line 926, in forward
    hidden_states = self.ln_f(hidden_states)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/normalization.py", line 190, in forward
    return F.layer_norm(
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/functional.py", line 2515, in layer_norm
    return torch.layer_norm(input, normalized_shape, weight, bias, eps, torch.backends.cudnn.enabled)
RuntimeError: expected scalar type Float but found Half
SpenRue commented 9 months ago

In scripts/tortoise_tts.py, I commented out the half option so it doesn't get assigned in the gen settings and that worked for me.

    speed_options = [
        "sampler",
        "original_tortoise",
        # "half",
    ]
kzhjymug commented 8 months ago

Having the same problem, commenting out the half option did not fix things unfortunately