152334H / tortoise-tts-fast

Fast TorToiSe inference (5x or your money back!)
GNU Affero General Public License v3.0
759 stars 177 forks source link

RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory #75

Open MJAnderson1 opened 1 year ago

MJAnderson1 commented 1 year ago

gettin' this error every time I run streamlit

RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

what am I doing wrong

Acephalia commented 1 year ago

Happened to me and I think this is because of a half downloaded weight. Head to : C:\Users\yourusername\ .cache and delete the voicefixer folder. The run app.py again. This should re-download the weights. Took me about 30 mins to download everything so be patient even if there is no activity on screen.

maepopi commented 1 year ago

Thank you SO much @Acephalia, that worked :)

Acephalia commented 1 year ago

Thank you SO much @Acephalia, that worked :)

You are welcome. If you want to try a slightly updated GUI with a few more QOL features I’ve formed a version here : https://github.com/Acephalia/tortoise-tts-fast-GUI

cheers

maepopi commented 1 year ago

Thank you! I reckon I've spoken a tiny bit too fast though. I've cleared the cache and re-run the streamit app script. The weights were on track of being downloaded again, but then it crashed and showed again the same error :(

I'm gonna try your fork instead...

maepopi commented 1 year ago

Yep, no, still have the same error :( No idea why that happens...

Acephalia commented 1 year ago

If the weights are not being fully downloaded then you will keep running into the issue unfortunately because there will always be a half file in the download. What is making the install crash? Any errors? Worst case I’ll upload the weights for you to download and put in the cache folder manually tomorrow. That should fix it.

maepopi commented 1 year ago

Here is the error

`Traceback (most recent call last): File "/home/maelys/anaconda3/envs/ttsgui/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script exec(code, module.dict) File "/home/maelys/AI_Projects/tortoise-tts-fast-GUI/app.py", line 556, in main() File "/home/maelys/AI_Projects/tortoise-tts-fast-GUI/app.py", line 443, in main tts = load_model(MODELS_DIR, high_vram, kv_cache, ar_checkpoint, diff_checkpoint) File "/home/maelys/anaconda3/envs/ttsgui/lib/python3.8/site-packages/streamlit/runtime/caching/cache_utils.py", line 194, in wrapper return cached_func(*args, *kwargs) File "/home/maelys/anaconda3/envs/ttsgui/lib/python3.8/site-packages/streamlit/runtime/caching/cache_utils.py", line 223, in call return self._get_or_create_cached_value(args, kwargs) File "/home/maelys/anaconda3/envs/ttsgui/lib/python3.8/site-packages/streamlit/runtime/caching/cache_utils.py", line 248, in _get_or_create_cached_value return self._handle_cache_miss(cache, value_key, func_args, func_kwargs) File "/home/maelys/anaconda3/envs/ttsgui/lib/python3.8/site-packages/streamlit/runtime/caching/cache_utils.py", line 302, in _handle_cache_miss computed_value = self._info.func(func_args, **func_kwargs) File "/home/maelys/AI_Projects/tortoise-tts-fast-GUI/app_utils/funcs.py", line 29, in load_model return TextToSpeech( File "/home/maelys/AI_Projects/tortoise-tts-fast-GUI/tortoise/api.py", line 315, in init self.clvp.load_state_dict(torch.load(clvp_path)) File "/home/maelys/anaconda3/envs/ttsgui/lib/python3.8/site-packages/torch/serialization.py", line 797, in load with _open_zipfile_reader(opened_file) as opened_zipfile: File "/home/maelys/anaconda3/envs/ttsgui/lib/python3.8/site-packages/torch/serialization.py", line 283, in init super().init(torch._C.PyTorchFileReader(name_or_buffer)) RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory'

Thank you so much for your help. I indeed am grateful if you can send me the actual weights!

Acephalia commented 1 year ago

Here is a link to download the models directly. Everything goes in the cache/tortoise/models folder.

I will make a change to my fork to actually use a local folder for models in the next commit so they aren't clogging up ones user directory.

maepopi commented 1 year ago

Thank you very much !! I’ll give it a try tomorrow. So basically I just have to put that into the voicefixer .cache directory ?

Acephalia commented 1 year ago

Thank you very much !! I’ll give it a try tomorrow. So basically I just have to put that into the voicefixer .cache directory ?

no problem. Yes, just replace everything in the tortoise models folder in cache.

maepopi commented 1 year ago

All right I'm so sorry I need to bother you again : I've basically thrown the PTH files into the root of the voicefixer folder inside the .cache folder. Then I launched the streamlit line again, but I still have the same error. When going back into the voicefixer directory, I can see that two folders have been created : "analysis module" and "synthesis module". Do I need to put the PTH files you sent me in there ? If yes, in which manner?

Thank you very much :)

photonbit commented 1 year ago

I had the same issue, the complete list of models is in https://github.com/Acephalia/tortoise-tts-fast-GUI/blob/main/tortoise/models/utils.py but they should go into ~/.cache/tortoise/models, not under ~/.cache/voicefixer. Both manual download and deleting the models directory worked for me.

maepopi commented 1 year ago

Oh god you're a savior! It worked perfectly thank you!

maepopi commented 1 year ago

By the way @Acephalia, I've been playing around with your GUI for a few hours now and it's amazing, thank you for exposing all the parameters so it's easier to play with! Great job :))

Acephalia commented 1 year ago

By the way @Acephalia, I've been playing around with your GUI for a few hours now and it's amazing, thank you for exposing all the parameters so it's easier to play with! Great job :))

Apologies. I had somehow missed your previous message and I also missed that you had asked if it was the voicefixer folder. My bad. It is the tortoise cache but you’ve already got that sorted thanks to @photonbit.

Thank you for the kind comments on the UI additions. I have been very busy and haven’t had much chance to do any further digging into it. Hopefully will be able to in a few weeks.

Checkout the mrq version as well as it has actual fine tuning.

maepopi commented 1 year ago

Hi @Acephalia thank you and don’t worry about it, I’m patient ☺️

For the mrq version, do you mean this? https://git.ecker.tech/mrq/ai-voice-cloning.git

There seems to be many tortoise forks and I’m a little bit confused 😂

Acephalia commented 1 year ago

Hi @Acephalia thank you and don’t worry about it, I’m patient ☺️

For the mrq version, do you mean this? https://git.ecker.tech/mrq/ai-voice-cloning.git

There seems to be many tortoise forks and I’m a little bit confused 😂

Yep that’s the one. It’s probably the best one around in my opinion. Weirdly though fast does seem to do some voices with just a few latents much better.

maepopi commented 1 year ago

Oh wow great, I’ll have a look then, thank you so much 😊😊

maepopi commented 1 year ago

All right I've been playing around with MRQ for a while and I must stay I'm a bit puzzled: none of my voices work well, like it really produces bad results. Did you tweak any specific parameters to get so good results? Or maybe I should try with less voices?

Acephalia commented 1 year ago

All right I've been playing around with MRQ for a while and I must stay I'm a bit puzzled: none of my voices work well, like it really produces bad results. Did you tweak any specific parameters to get so good results? Or maybe I should try with less voices?

I haven’t had much luck using the mrq version for generating decent results with just the conditioning latents. Fast is better for that and I’m not quite sure why. Mrq is great for fine tuning the model. This essentially is training using transcripts and about 15-30mins of audio to make your own fine tune which you use instead of the standard model. Checkout the training section in the mrq wiki for more info.

For just using conditional latents use Fast and use 30-50 clips around 5-8 seconds long. Make sure clips don’t start or end mid speech/word. This is the most important thing I’ve learnt.

Also Quality > Quantity. 5-10 high quality audio clips will trump 50 bad clips and if there’s one bad clip in the sample pool it will mess up your latent.

When generating always run batches of 5-8 with a high iteration count (75-100) and anywhere between 10-30 samples. Each latent will have its own sweet spot and it may take a little longer but the quality is far superior.

maepopi commented 1 year ago

Hey @Acephalia, thank you very much for your advice!

When playing around with the original Tortoise-tts model, I have come to notice the same things as you in terms of how many and what types of clips to use. If I understand correctly, however, the last part of your message with the advice aout using conditional latents is to be applied to fast tortoise and not mrq right? Because mrq is for fine tuning and thus creating a new model?

Thank you again so much :)

liseen315 commented 10 months ago

Hi,when i download all model finish, i run " streamlit run scripts/app.py", but get the error

`2023-09-09 00:17:45.717 Uncaught app exception Traceback (most recent call last): File "D:\Miniconda\envs\ttts-fast\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 263, in _get_or_create_cached_value cached_result = cache.read_result(value_key) File "D:\Miniconda\envs\ttts-fast\lib\site-packages\streamlit\runtime\caching\cache_resource_api.py", line 500, in read_result raise CacheKeyNotFoundError() streamlit.runtime.caching.cache_errors.CacheKeyNotFoundError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Miniconda\envs\ttts-fast\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 311, in _handle_cache_miss cached_result = cache.read_result(value_key) File "D:\Miniconda\envs\ttts-fast\lib\site-packages\streamlit\runtime\caching\cache_resource_api.py", line 500, in read_result raise CacheKeyNotFoundError() streamlit.runtime.caching.cache_errors.CacheKeyNotFoundError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Miniconda\envs\ttts-fast\lib\site-packages\urllib3\connectionpool.py", line 711, in urlopen self._prepare_proxy(conn) File "D:\Miniconda\envs\ttts-fast\lib\site-packages\urllib3\connectionpool.py", line 1007, in _prepare_proxy conn.connect() File "D:\Miniconda\envs\ttts-fast\lib\site-packages\urllib3\connection.py", line 369, in connect self.sock = conn = self._connect_tls_proxy(hostname, conn) File "D:\Miniconda\envs\ttts-fast\lib\site-packages\urllib3\connection.py", line 504, in _connect_tls_proxy socket = ssl_wrapsocket( File "D:\Miniconda\envs\ttts-fast\lib\site-packages\urllib3\util\ssl.py", line 453, in ssl_wrap_socket ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_intls) File "D:\Miniconda\envs\ttts-fast\lib\site-packages\urllib3\util\ssl.py", line 495, in _ssl_wrap_socket_impl return ssl_context.wrap_socket(sock) File "D:\Miniconda\envs\ttts-fast\lib\ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "D:\Miniconda\envs\ttts-fast\lib\ssl.py", line 1040, in _create self.do_handshake() File "D:\Miniconda\envs\ttts-fast\lib\ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:1131)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Miniconda\envs\ttts-fast\lib\site-packages\requests\adapters.py", line 486, in send resp = conn.urlopen( File "D:\Miniconda\envs\ttts-fast\lib\site-packages\urllib3\connectionpool.py", line 798, in urlopen retries = retries.increment( File "D:\Miniconda\envs\ttts-fast\lib\site-packages\urllib3\util\retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /jbetker/wav2vec2-large-robust-ft-libritts-voxpopuli/resolve/main/config.json (Caused by SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1131)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Miniconda\envs\ttts-fast\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 552, in _run_script exec(code, module.dict) File "D:\tortoise-tts-fast\scripts\app.py", line 278, in main() File "D:\tortoise-tts-fast\scripts\app.py", line 180, in main tts = load_model(model_dir, high_vram, kv_cache, ar_checkpoint, diff_checkpoint) File "D:\Miniconda\envs\ttts-fast\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 211, in wrapper return cached_func(*args, kwargs) File "D:\Miniconda\envs\ttts-fast\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 240, in call return self._get_or_create_cached_value(args, kwargs) File "D:\Miniconda\envs\ttts-fast\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 266, in _get_or_create_cached_value return self._handle_cache_miss(cache, value_key, func_args, func_kwargs) File "D:\Miniconda\envs\ttts-fast\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 320, in _handle_cache_miss computed_value = self._info.func(*func_args, *func_kwargs) File "D:\tortoise-tts-fast\app_utils\funcs.py", line 29, in load_model return TextToSpeech( File "D:\tortoise-tts-fast\tortoise\api.py", line 245, in init self.aligner = Wav2VecAlignment() File "D:\tortoise-tts-fast\tortoise\utils\wav2vec_alignment.py", line 52, in init self.model = Wav2Vec2ForCTC.from_pretrained( File "D:\Miniconda\envs\ttts-fast\lib\site-packages\transformers\modeling_utils.py", line 2377, in from_pretrained resolved_config_file = cached_file( File "D:\Miniconda\envs\ttts-fast\lib\site-packages\transformers\utils\hub.py", line 429, in cached_file resolved_file = hf_hub_download( File "D:\Miniconda\envs\ttts-fast\lib\site-packages\huggingface_hub\utils_validators.py", line 118, in _inner_fn return fn(args, kwargs) File "D:\Miniconda\envs\ttts-fast\lib\site-packages\huggingface_hub\file_download.py", line 1195, in hf_hub_download metadata = get_hf_file_metadata( File "D:\Miniconda\envs\ttts-fast\lib\site-packages\huggingface_hub\utils_validators.py", line 118, in _inner_fn return fn(args, kwargs) File "D:\Miniconda\envs\ttts-fast\lib\site-packages\huggingface_hub\file_download.py", line 1532, in get_hf_file_metadata r = _request_wrapper( File "D:\Miniconda\envs\ttts-fast\lib\site-packages\huggingface_hub\file_download.py", line 407, in _request_wrapper response = _request_wrapper( File "D:\Miniconda\envs\ttts-fast\lib\site-packages\huggingface_hub\file_download.py", line 442, in _request_wrapper return http_backoff( File "D:\Miniconda\envs\ttts-fast\lib\site-packages\huggingface_hub\utils_http.py", line 258, in http_backoff response = session.request(method=method, url=url, kwargs) File "D:\Miniconda\envs\ttts-fast\lib\site-packages\requests\sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "D:\Miniconda\envs\ttts-fast\lib\site-packages\requests\sessions.py", line 703, in send r = adapter.send(request, kwargs) File "D:\Miniconda\envs\ttts-fast\lib\site-packages\huggingface_hub\utils_http.py", line 63, in send return super().send(request, args, **kwargs) File "D:\Miniconda\envs\ttts-fast\lib\site-packages\requests\adapters.py", line 517, in send raise SSLError(e, request=request) requests.exceptions.SSLError: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /jbetker/wav2vec2-large-robust-ft-libritts-voxpopuli/resolve/main/config.json (Caused by SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1131)')))"), '(Request ID: a35fcf77-200d-414c-a43c-07236924ce25)')`