freddyaboulton HF staff commited on
Commit
13b0a33
1 Parent(s): 490c58a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -77,12 +77,13 @@ def set_api_key(claude_key, play_ht_username, play_ht_key):
77
  claude_client = anthropic.Anthropic(api_key=claude_key)
78
  play_ht_client = PyHtClient(user_id=play_ht_username, api_key=play_ht_key)
79
  except:
80
- gr.Error("Invalid API keys. Please try again.")
81
  gr.Info("Successfully set API keys.", duration=3)
82
  return Clients(claude=claude_client, play_ht=play_ht_client,
83
  hf=InferenceClient()), gr.skip()
84
 
85
 
 
86
  def response(audio: tuple[int, np.ndarray], conversation_llm_format: list[dict],
87
  chatbot: list[dict], client_state: Clients):
88
  if not client_state:
 
77
  claude_client = anthropic.Anthropic(api_key=claude_key)
78
  play_ht_client = PyHtClient(user_id=play_ht_username, api_key=play_ht_key)
79
  except:
80
+ raise gr.Error("Invalid API keys. Please try again.")
81
  gr.Info("Successfully set API keys.", duration=3)
82
  return Clients(claude=claude_client, play_ht=play_ht_client,
83
  hf=InferenceClient()), gr.skip()
84
 
85
 
86
+
87
  def response(audio: tuple[int, np.ndarray], conversation_llm_format: list[dict],
88
  chatbot: list[dict], client_state: Clients):
89
  if not client_state: