diff --git a/README.md b/README.md index 30edfcd45..8470af562 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ - [Running the voice changer](#running-the-voice-changer-1) - [Running on Colab/Kaggle](#running-on-colabkaggle) - [Troubleshooting](#troubleshooting) - - [Exceptions.WeightDownloadException: 'Failed to download weight.'](#exceptionsweightdownloadexception-failed-to-download-weight) + - [Exceptions.PretrainDownloadException: 'Failed to download weight.'](#exceptionspretraindownloadexception-failed-to-download-weight) - [Audio devices are not displayed](#audio-devices-are-not-displayed) - [No sound after start](#no-sound-after-start) - [Hearing non-converted voice](#hearing-non-converted-voice) @@ -239,13 +239,13 @@ Refer to corresponding [Colab](https://github.com/deiteris/voice-changer/blob/ma > [!TIP] > When any issue with the voice changer occurs, check the command line window (the one that opens during the start) for errors. -### Exceptions.WeightDownloadException: 'Failed to download weight.' +### Exceptions.PretrainDownloadException: 'Failed to download weight.' Either the remote files have changed or your files were corrupted. The error will show which files are affected above the error: ``` -[Voice Changer] 'pretrain/content_vec_500.onnx failed to pass hash verification check. Got 1931e237626b80d65ae44cbacd4a5197, expected ab288ca5b540a4a15909a40edf875d1e' -[Voice Changer] 'pretrain/rmvpe.onnx failed to pass hash verification check. Got 65030149d579a65f15aa7e85769c32f1, expected b6979bf69503f8ec48c135000028a7b0' +[WeightDownloader] 'pretrain/content_vec_500.onnx failed to pass hash verification check. Got 1931e237626b80d65ae44cbacd4a5197, expected ab288ca5b540a4a15909a40edf875d1e' +[WeightDownloader] 'pretrain/rmvpe.onnx failed to pass hash verification check. Got 65030149d579a65f15aa7e85769c32f1, expected b6979bf69503f8ec48c135000028a7b0' ``` Find and delete the mentioned files from the voice changer folder and restart the voice changer. Deleted files will be re-downloaded. diff --git a/server/Exceptions.py b/server/Exceptions.py index 57c2a8e82..922ae9059 100644 --- a/server/Exceptions.py +++ b/server/Exceptions.py @@ -3,9 +3,9 @@ def __str__(self): return repr("Voice Changer is not selected.") -class WeightDownloadException(Exception): +class PretrainDownloadException(Exception): def __str__(self): - return repr("Failed to download weight.") + return repr("Failed to download pretrain models.") class DownloadVerificationException(Exception): def __init__(self, filename: str, got_hash: str, expected_hash: str) -> None: diff --git a/server/downloader/WeightDownloader.py b/server/downloader/WeightDownloader.py index da5caf6c6..e1563806c 100644 --- a/server/downloader/WeightDownloader.py +++ b/server/downloader/WeightDownloader.py @@ -3,7 +3,7 @@ from downloader.Downloader import download import logging from settings import ServerSettings -from Exceptions import WeightDownloadException +from Exceptions import PretrainDownloadException logger = logging.getLogger(__name__) @@ -79,11 +79,12 @@ async def downloadWeight(params: ServerSettings): for file in files_to_download: tasks.append(asyncio.ensure_future(download(file))) fail = False - for res in await asyncio.gather(*tasks, return_exceptions=True): + for i, res in enumerate(await asyncio.gather(*tasks, return_exceptions=True)): if isinstance(res, Exception): + logger.error(f'Failed to download or verify {files_to_download[i]["saveTo"]}') fail = True logger.exception(res) if fail: - raise WeightDownloadException() + raise PretrainDownloadException() logger.info('All weights are loaded!')