puntorigen / podcast_tts

A class for generating realistic audio (TTS) for podcasts and dialogues.
MIT License
9 stars 0 forks source link

ran into '_lzma.LZMAError: Corrupt input data' #1

Closed liw71 closed 10 hours ago

liw71 commented 23 hours ago

on my laptop(Macbook m1), I ran into decompress issue when I tried the same demo test, INFO[0078] #3.3 finished download asset/tokenizer/tokenizer.json INFO[0078] all download tasks finished. Generating audio for chunk 1/1: Hello [uv_break] Welcome to our podcast. text: 0%|▍ | 1/500(max) [00:00, 5.87it/s]We detected that you are passingpast_key_valuesas a tuple of tuples. This is deprecated and will be removed in v4.47. Please convert your cache or use an appropriateCache` class (https://huggingface.co/docs/transformers/kv_cache#legacy-cache-format) text: 2%|████▍ | 11/500(max) [00:00, 15.58it/s] Traceback (most recent call last): File "", line 1, in File "/Users/weili/anaconda3/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/Users/weili/anaconda3/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/weili/anaconda3/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "", line 3, in main File "/Users/weili/anaconda3/lib/python3.11/site-packages/podcast_tts/podcast_tts.py", line 314, in generate_wav wavs = await asyncio.to_thread( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/weili/anaconda3/lib/python3.11/asyncio/threads.py", line 25, in to_thread return await loop.run_in_executor(None, func_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/weili/anaconda3/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/weili/anaconda3/lib/python3.11/site-packages/ChatTTS/core.py", line 221, in infer return next(res_gen) ^^^^^^^^^^^^^ File "/Users/weili/anaconda3/lib/python3.11/site-packages/ChatTTS/core.py", line 385, in _infer for result in self._infer_code( ^^^^^^^^^^^^^^^^^ File "/Users/weili/anaconda3/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context return func(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/Users/weili/anaconda3/lib/python3.11/site-packages/ChatTTS/core.py", line 546, in _infer_code self.speaker.apply( File "/Users/weili/anaconda3/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context return func(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/Users/weili/anaconda3/lib/python3.11/site-packages/ChatTTS/model/speaker.py", line 32, in apply spk_emb_tensor = torch.from_numpy(self._decode(spk_emb)) ^^^^^^^^^^^^^^^^^^^^^ File "/Users/weili/anaconda3/lib/python3.11/site-packages/ChatTTS/model/speaker.py", line 148, in _decode lzma.decompress( File "/Users/weili/anaconda3/lib/python3.11/lzma.py", line 343, in decompress res = decomp.decompress(data) ^^^^^^^^^^^^^^^^^^^^^^^ _lzma.LZMAError: Corrupt input data

(base) weili@Weis-MacBook-Pro Downloads %`

puntorigen commented 11 hours ago

Hi @liw71 ,

Thank you for bringing this up and providing detailed logs! It looks like the issue may be related to the lzma library, which is used for decompressing speaker embedding files. Let’s focus on that first and troubleshoot the problem step by step.

Possible Cause: lzma Library

The _lzma.LZMAError: Corrupt input data error often points to a problem with the lzma library or the integrity of the speaker files being decompressed. Since you’re using Anaconda, it’s possible that the version of lzma bundled with your Python installation is causing the issue.

  1. Verify and Reinstall lzma To ensure lzma is properly installed, try reinstalling it using Conda: conda install -c conda-forge python-lzma

  2. Test with Fresh Voices The speaker files might have been corrupted during download. To test this, try changing the speaker names in the example script to generate new profiles. For example: texts = [ {"Speaker1": ["Welcome to the podcast!", "both"]}, {"Speaker2": ["Today, we discuss AI advancements.", "left"]}, ] This will create new voice profiles dynamically and avoid using the existing files.

  3. Environment Compatibility This package was primarily tested on Python 3.10 in server-like environments (e.g., FastAPI) without using Anaconda. If possible, try creating a clean virtual environment without Anaconda to see if it resolves the issue: python3.10 -m venv podcast_tts_env source podcast_tts_env/bin/activate pip install podcast_tts Alternatively, upgrading to Python 3.12 may also help as it has been tested successfully on macOS M1 systems.

Please try the above steps and let me know if the issue persists. If none of these resolve the problem, I can help investigate further or look into potential compatibility issues with the Anaconda setup.

Thank you for your patience, and I appreciate your help in improving podcast_tts!