Skip to content

Commit

Permalink
Optimize TTS error info (#60)
Browse files Browse the repository at this point in the history
* fix(tts) : fix error info

* fix(tts) : fix error info

* fix(tts) : fix syntax issue with black
  • Loading branch information
bobmayuze authored Nov 16, 2023
1 parent d7c8335 commit 2865900
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions advanced/tts/tts_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,20 @@ def tts(
if tts_model.is_multi_lingual and language is None:
raise HTTPException(
status_code=400,
detail="Model is multi-lingual, you should pass in language.",
detail=(
"Model is multi-lingual, you should pass in language. "
" Use GET /languages to get available languages and pass in "
" as optional parameters"
),
)
if tts_model.is_multi_speaker and speaker is None:
raise HTTPException(
status_code=400,
detail="Model is multi-speaker, you should pass in speaker.",
detail=(
"Model is multi-speaker, you should pass in speaker. "
" Use GET /speakers to get available speakers and pass in as "
" optional parameters"
),
)

try:
Expand Down

0 comments on commit 2865900

Please sign in to comment.