Spaces:
Sleeping
Sleeping
Sofia Casadei
commited on
Commit
·
623d479
1
Parent(s):
bb400c2
fix: connection
Browse files- main.py +1 -1
- static/index.html +3 -0
main.py
CHANGED
@@ -152,7 +152,7 @@ async def index():
|
|
152 |
|
153 |
rtc_configuration = await get_cloudflare_turn_credentials_async(hf_token=os.getenv("HF_TOKEN")) if APP_MODE == "deployed" else None
|
154 |
logger.info(f"RTC configuration: {rtc_configuration}")
|
155 |
-
html_content = html_content.replace("
|
156 |
return HTMLResponse(content=html_content)
|
157 |
|
158 |
@app.get("/transcript")
|
|
|
152 |
|
153 |
rtc_configuration = await get_cloudflare_turn_credentials_async(hf_token=os.getenv("HF_TOKEN")) if APP_MODE == "deployed" else None
|
154 |
logger.info(f"RTC configuration: {rtc_configuration}")
|
155 |
+
html_content = html_content.replace("__INJECTED_RTC_CONFIG__", json.dumps(rtc_configuration))
|
156 |
return HTMLResponse(content=html_content)
|
157 |
|
158 |
@app.get("/transcript")
|
static/index.html
CHANGED
@@ -5,6 +5,9 @@
|
|
5 |
<meta charset="UTF-8">
|
6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7 |
<title>Real-time Whisper Transcription</title>
|
|
|
|
|
|
|
8 |
<style>
|
9 |
:root {
|
10 |
--primary-gradient: linear-gradient(135deg, #f9a45c 0%, #e66465 100%);
|
|
|
5 |
<meta charset="UTF-8">
|
6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7 |
<title>Real-time Whisper Transcription</title>
|
8 |
+
<script>
|
9 |
+
window.__RTC_CONFIGURATION__ = __INJECTED_RTC_CONFIG__;
|
10 |
+
</script>
|
11 |
<style>
|
12 |
:root {
|
13 |
--primary-gradient: linear-gradient(135deg, #f9a45c 0%, #e66465 100%);
|