freddyaboulton HF Staff commited on
Commit
9881fbd
·
verified ·
1 Parent(s): 100e3b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -13,7 +13,7 @@ from fastrtc import (
13
  AdditionalOutputs,
14
  AsyncStreamHandler,
15
  Stream,
16
- get_twilio_turn_credentials,
17
  wait_for_item,
18
  )
19
  from gradio.utils import get_space
@@ -109,7 +109,7 @@ stream.mount(app)
109
 
110
  @app.get("/")
111
  async def _():
112
- rtc_config = get_twilio_turn_credentials() if get_space() else None
113
  html_content = (cur_dir / "index.html").read_text()
114
  html_content = html_content.replace("__RTC_CONFIGURATION__", json.dumps(rtc_config))
115
  return HTMLResponse(content=html_content)
 
13
  AdditionalOutputs,
14
  AsyncStreamHandler,
15
  Stream,
16
+ get_cloudflare_turn_credentials_async,
17
  wait_for_item,
18
  )
19
  from gradio.utils import get_space
 
109
 
110
  @app.get("/")
111
  async def _():
112
+ rtc_config = await get_cloudflare_turn_credentials_async() if get_space() else None
113
  html_content = (cur_dir / "index.html").read_text()
114
  html_content = html_content.replace("__RTC_CONFIGURATION__", json.dumps(rtc_config))
115
  return HTMLResponse(content=html_content)