jbilcke-hf HF Staff commited on
Commit
c9ed4f6
·
verified ·
1 Parent(s): 493dd46

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -41,7 +41,9 @@ def predict(request: gr.Request, *args, progress=gr.Progress(track_tqdm=True)):
41
  userInfo = hf_api.whoami(token)
42
  if not userInfo:
43
  raise gr.Error("The provided API key is invalid!")
44
-
 
 
45
  headers = {'Content-Type': 'application/json'}
46
 
47
  payload = {"input": {}}
 
41
  userInfo = hf_api.whoami(token)
42
  if not userInfo:
43
  raise gr.Error("The provided API key is invalid!")
44
+ except:
45
+ raise gr.Error("The provider API key is invalid!")
46
+
47
  headers = {'Content-Type': 'application/json'}
48
 
49
  payload = {"input": {}}