Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print helpful error message if models not found #416

Merged
3 commits merged into from Jul 10, 2020
Merged

Print helpful error message if models not found #416

3 commits merged into from Jul 10, 2020

Conversation

ghost
Copy link

@ghost ghost commented Jul 10, 2020

A lot of people don't know what to do with the "No encoder models found in encoder/saved_models" error message, leading to issues like #387, #393 and #412.

We just updated README.md to emphasize that downloading the pretrained models is part of the setup process, in #414 . However, I would also like to print a helpful error message when no models are found. This will allow the user to fix their own problem.

@ghost ghost requested a review from CorentinJ July 10, 2020 09:10
demo_cli.py Outdated
Comment on lines 56 to 61
## Print helpful error message if models are not present
if not args.enc_model_fpath.is_file():
if not args.syn_model_dir.is_dir():
if not args.voc_model_fpath.is_file():
print("Error: Model files not found. If needed, download them here: https://github.com/CorentinJ/Real-Time-Voice-Cloning/wiki/Pretrained-models")
quit(-1)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Extract a function so you can reuse instead of duplicating the code
  • Use ands instead of chaining ifs
  • Break the line above 100 chars

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the suggestions @CorentinJ . The latest commit should resolve these issues. Let me know if you think of any other improvements.

@ghost ghost merged commit ad7f01d into CorentinJ:master Jul 10, 2020
@ghost ghost deleted the 412_model_exception branch July 10, 2020 15:46
@ghost ghost mentioned this pull request Aug 14, 2020
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant