tts_exceptions.py 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. # Copyright (c) Alibaba, Inc. and its affiliates.
  2. """
  3. Define TTS exceptions
  4. """
  5. class TtsException(Exception):
  6. """
  7. TTS exception class.
  8. """
  9. pass
  10. class TtsModelConfigurationException(TtsException):
  11. """
  12. TTS model configuration exceptions.
  13. """
  14. pass
  15. class TtsModelNotExistsException(TtsException):
  16. """
  17. TTS model not exists exception.
  18. """
  19. class TtsVoiceNotExistsException(TtsException):
  20. """
  21. TTS voice not exists exception.
  22. """
  23. pass
  24. class TtsFrontendException(TtsException):
  25. """
  26. TTS frontend module level exceptions.
  27. """
  28. pass
  29. class TtsFrontendInitializeFailedException(TtsFrontendException):
  30. """
  31. If tts frontend resource is invalid or not exist, this exception will be raised.
  32. """
  33. pass
  34. class TtsFrontendLanguageTypeInvalidException(TtsFrontendException):
  35. """
  36. If language type is invalid, this exception will be raised.
  37. """
  38. class TtsVocoderException(TtsException):
  39. """
  40. Vocoder exception
  41. """
  42. class TtsVocoderMelspecShapeMismatchException(TtsVocoderException):
  43. """
  44. If vocoder's input melspec shape mismatch, this exception will be raised.
  45. """
  46. class TtsDataPreprocessorException(TtsException):
  47. """
  48. Tts data preprocess exception
  49. """
  50. class TtsDataPreprocessorDirNotExistsException(TtsDataPreprocessorException):
  51. """
  52. If any dir is not exists, this exception will be raised.
  53. """
  54. class TtsDataPreprocessorAudioConfigNotExistsException(
  55. TtsDataPreprocessorException):
  56. """
  57. If audio config is not exists, this exception will be raised.
  58. """
  59. class TtsTrainingException(TtsException):
  60. """
  61. Tts training exception
  62. """
  63. class TtsTrainingHparamsInvalidException(TtsException):
  64. """
  65. If training hparams is invalid, this exception will be raised.
  66. """
  67. class TtsTrainingWorkDirNotExistsException(TtsTrainingException):
  68. """
  69. If training work dir not exists, this exception will be raised.
  70. """
  71. class TtsTrainingCfgNotExistsException(TtsTrainingException):
  72. """
  73. If training cfg not exists, this exception will be raised.
  74. """
  75. class TtsTrainingDatasetInvalidException(TtsTrainingException):
  76. """
  77. If dataset invalid, this exception will be raised.
  78. """
  79. class TtsTrainingInvalidModelException(TtsTrainingException):
  80. """
  81. If model is invalid or not exists, this exception will be raised.
  82. """