Error with facebook/mms-tts-eng generation

Traceback (most recent call last):
File “/usr/local/lib/python3.10/dist-packages/gradio/queueing.py”, line 495, in call_prediction
output = await route_utils.call_process_api(
File “/usr/local/lib/python3.10/dist-packages/gradio/route_utils.py”, line 230, in call_process_api
output = await app.get_blocks().process_api(
File “/usr/local/lib/python3.10/dist-packages/gradio/blocks.py”, line 1590, in process_api
result = await self.call_function(
File “/usr/local/lib/python3.10/dist-packages/gradio/blocks.py”, line 1188, in call_function
prediction = await utils.async_iteration(iterator)
File “/usr/local/lib/python3.10/dist-packages/gradio/utils.py”, line 502, in async_iteration
return await iterator.anext()
File “/usr/local/lib/python3.10/dist-packages/gradio/utils.py”, line 495, in anext
return await anyio.to_thread.run_sync(
File “/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py”, line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File “/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py”, line 877, in run_sync_in_worker_thread
return await future
File “/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py”, line 807, in run
result = context.run(func, *args)
File “/usr/local/lib/python3.10/dist-packages/gradio/utils.py”, line 478, in run_sync_iterator_async
return next(iterator)
File “/usr/local/lib/python3.10/dist-packages/gradio/utils.py”, line 661, in gen_wrapper
response = next(iterator)
File “”, line 249, in generate_voice
sample_rate, audio = synthesise_speech(translated_temp, language)
File “”, line 87, in synthesise_speech
tts_output = tts_model(**inputs).waveform
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py”, line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py”, line 1527, in _call_impl
return forward_call(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/transformers/models/vits/modeling_vits.py”, line 1421, in forward
text_encoder_output = self.text_encoder(
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py”, line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py”, line 1527, in _call_impl
return forward_call(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/transformers/models/vits/modeling_vits.py”, line 1218, in forward
hidden_states = self.embed_tokens(input_ids) * math.sqrt(self.config.hidden_size)
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py”, line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py”, line 1527, in _call_impl
return forward_call(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/torch/nn/modules/sparse.py”, line 162, in forward
return F.embedding(
File “/usr/local/lib/python3.10/dist-packages/torch/nn/functional.py”, line 2233, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected tensor for argument #1 ‘indices’ to have one of the following scalar types: Long, Int; but got torch.FloatTensor instead (while checking arguments for embedding)

You are passing a floating point tensor to an nn.Embedding layer while an integer type is expected.

Thank you. Found the resolution.

I am also facing the same issue. What is the resolution ?

Pass the input to embedding layers as integer types, not floating point types.