freddyaboulton HF Staff commited on
Commit
1256cfc
·
verified ·
1 Parent(s): 4c239c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -23,16 +23,15 @@ tts_model = get_tts_model()
23
  conversations: dict[str, list[dict[str, str]]] = {}
24
 
25
 
 
 
 
26
  def response(
27
  audio: tuple[int, np.ndarray],
28
  hf_token: str | None,
29
  ):
30
  if hf_token is None:
31
  raise WebRTCError("HF Token is required")
32
- llm_client = InferenceClient(
33
- provider="groq",
34
- api_key=hf_token,
35
- )
36
  context = get_current_context()
37
  if context.webrtc_id not in conversations:
38
  conversations[context.webrtc_id] = [
@@ -55,6 +54,7 @@ def response(
55
  messages=messages, # type: ignore
56
  max_tokens=1024,
57
  stream=True,
 
58
  )
59
 
60
  output_text = ""
 
23
  conversations: dict[str, list[dict[str, str]]] = {}
24
 
25
 
26
+ llm_client = InferenceClient(provider="groq")
27
+
28
+
29
  def response(
30
  audio: tuple[int, np.ndarray],
31
  hf_token: str | None,
32
  ):
33
  if hf_token is None:
34
  raise WebRTCError("HF Token is required")
 
 
 
 
35
  context = get_current_context()
36
  if context.webrtc_id not in conversations:
37
  conversations[context.webrtc_id] = [
 
54
  messages=messages, # type: ignore
55
  max_tokens=1024,
56
  stream=True,
57
+ token=hf_token,
58
  )
59
 
60
  output_text = ""