Better error message when unable to load space

#3
by sanchit-gandhi HF staff - opened
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -64,7 +64,10 @@ def verify_demo(repo_id):
64
  try:
65
  client = Client(repo_id, hf_token=HF_TOKEN)
66
  except Exception as e:
67
- raise gr.Error(f"Error with loading Space: {e}")
 
 
 
68
 
69
  try:
70
  audio_file = client.predict("test_short.wav", api_name="/predict")
 
64
  try:
65
  client = Client(repo_id, hf_token=HF_TOKEN)
66
  except Exception as e:
67
+ raise gr.Error("Error with loading Space. First check that your Space has been built and is running."
68
+ "Then check that your Space takes an audio file as input and returns an audio as output. If it is working"
69
+ f"as expected and the error persists, open an issue on this Space. Error: {e}"
70
+ )
71
 
72
  try:
73
  audio_file = client.predict("test_short.wav", api_name="/predict")