miaw1419 commited on
Commit
22f62a1
·
verified ·
1 Parent(s): 726c69b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -471,6 +471,18 @@ def api_fn(api):
471
  except anthropic.AuthenticationError:
472
  gr.Warning("Invalid API!")
473
  valid_api = ""
 
 
 
 
 
 
 
 
 
 
 
 
474
 
475
 
476
  def generate_out(prompt, vp_pos, vp_neg, slider, example_prompt, gallery, num_inference_steps, seed, randomize_seed):
 
471
  except anthropic.AuthenticationError:
472
  gr.Warning("Invalid API!")
473
  valid_api = ""
474
+
475
+ except anthropic.BadRequestError:
476
+ gr.Warning("Invalid API!")
477
+ valid_api = ""
478
+
479
+ except anthropic.PermissionDeniedError:
480
+ gr.Warning("Invalid API!")
481
+ valid_api = ""
482
+
483
+ except anthropic.RateLimitError:
484
+ gr.Warning("Invalid API!")
485
+ valid_api = ""
486
 
487
 
488
  def generate_out(prompt, vp_pos, vp_neg, slider, example_prompt, gallery, num_inference_steps, seed, randomize_seed):