freddyaboulton HF Staff commited on
Commit
53b9cff
·
verified ·
1 Parent(s): ec7fdae

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. app.py +12 -11
  2. index.html +0 -1
  3. requirements.txt +1 -1
app.py CHANGED
@@ -1,19 +1,19 @@
1
- from dotenv import load_dotenv
 
 
 
2
 
3
- import numpy as np
4
  import gradio as gr
5
- from gradio.utils import get_space
6
- from fastrtc import ReplyOnPause, Stream, AdditionalOutputs, get_twilio_turn_credentials
7
- from fastrtc.utils import audio_to_bytes, aggregate_bytes_to_16bit
8
- from pathlib import Path
9
  from fastapi.responses import HTMLResponse, StreamingResponse
 
 
 
10
  from groq import Groq
11
- import anthropic
12
- from elevenlabs import ElevenLabs
13
- import os
14
  from pydantic import BaseModel
15
- import json
16
- import logging
17
 
18
  # Configure the root logger to WARNING to suppress debug messages from other libraries
19
  logging.basicConfig(level=logging.WARNING)
@@ -87,6 +87,7 @@ stream = Stream(
87
  additional_inputs=[chatbot],
88
  additional_outputs=[chatbot],
89
  rtc_configuration=get_twilio_turn_credentials() if get_space() else None,
 
90
  )
91
 
92
 
 
1
+ import json
2
+ import logging
3
+ import os
4
+ from pathlib import Path
5
 
6
+ import anthropic
7
  import gradio as gr
8
+ import numpy as np
9
+ from dotenv import load_dotenv
10
+ from elevenlabs import ElevenLabs
 
11
  from fastapi.responses import HTMLResponse, StreamingResponse
12
+ from fastrtc import AdditionalOutputs, ReplyOnPause, Stream, get_twilio_turn_credentials
13
+ from fastrtc.utils import aggregate_bytes_to_16bit, audio_to_bytes
14
+ from gradio.utils import get_space
15
  from groq import Groq
 
 
 
16
  from pydantic import BaseModel
 
 
17
 
18
  # Configure the root logger to WARNING to suppress debug messages from other libraries
19
  logging.basicConfig(level=logging.WARNING)
 
87
  additional_inputs=[chatbot],
88
  additional_outputs=[chatbot],
89
  rtc_configuration=get_twilio_turn_credentials() if get_space() else None,
90
+ concurrency_limit=20 if get_space() else None,
91
  )
92
 
93
 
index.html CHANGED
@@ -246,7 +246,6 @@
246
  button.textContent = "Stop";
247
 
248
  const config = __RTC_CONFIGURATION__;
249
- console.log("config", config);
250
  webrtcPeerConnection = new RTCPeerConnection(config);
251
  const webrtcId = generateId();
252
 
 
246
  button.textContent = "Stop";
247
 
248
  const config = __RTC_CONFIGURATION__;
 
249
  webrtcPeerConnection = new RTCPeerConnection(config);
250
  const webrtcId = generateId();
251
 
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
- fastrtc[vad]==0.0.32rc1
2
  elevenlabs
3
  groq
4
  anthropic
 
1
+ fastrtc[vad]
2
  elevenlabs
3
  groq
4
  anthropic