TGPro1 commited on
Commit
6ba9170
·
1 Parent(s): af07f21

Better error diagnostics

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -89,6 +89,10 @@ def text_to_speech_app(prompt: str, voice: str, emotion: str, use_random_seed: b
89
  active_key = user_provided_key if user_provided_key else SYSTEM_API_KEY
90
  is_paid_user = len(user_provided_key) > 5
91
 
 
 
 
 
92
  # 2. Validation
93
  if not prompt.strip():
94
  raise gr.Error("Prompt cannot be empty.")
 
89
  active_key = user_provided_key if user_provided_key else SYSTEM_API_KEY
90
  is_paid_user = len(user_provided_key) > 5
91
 
92
+ # Check if we have ANY key
93
+ if not active_key:
94
+ return None, "❌ Erreur: Secret 'POLLINATIONS_TOKEN' manquant dans les paramètres du Space (Hugging Face Settings -> Secrets)."
95
+
96
  # 2. Validation
97
  if not prompt.strip():
98
  raise gr.Error("Prompt cannot be empty.")