Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Upload folder using huggingface_hub
Browse files- app.py +4 -4
- requirements.txt +1 -1
app.py
CHANGED
@@ -1,21 +1,20 @@
|
|
1 |
import asyncio
|
2 |
import base64
|
|
|
3 |
from pathlib import Path
|
4 |
|
5 |
import gradio as gr
|
6 |
-
from gradio.utils import get_space
|
7 |
import numpy as np
|
8 |
-
import json
|
9 |
import openai
|
10 |
from dotenv import load_dotenv
|
|
|
11 |
from fastrtc import (
|
12 |
AdditionalOutputs,
|
13 |
AsyncStreamHandler,
|
14 |
Stream,
|
15 |
get_twilio_turn_credentials,
|
16 |
)
|
17 |
-
from
|
18 |
-
|
19 |
from openai.types.beta.realtime import ResponseAudioTranscriptDoneEvent
|
20 |
|
21 |
load_dotenv()
|
@@ -117,6 +116,7 @@ stream = Stream(
|
|
117 |
additional_outputs=[chatbot],
|
118 |
additional_outputs_handler=update_chatbot,
|
119 |
rtc_configuration=get_twilio_turn_credentials() if get_space() else None,
|
|
|
120 |
)
|
121 |
|
122 |
|
|
|
1 |
import asyncio
|
2 |
import base64
|
3 |
+
import json
|
4 |
from pathlib import Path
|
5 |
|
6 |
import gradio as gr
|
|
|
7 |
import numpy as np
|
|
|
8 |
import openai
|
9 |
from dotenv import load_dotenv
|
10 |
+
from fastapi.responses import HTMLResponse, StreamingResponse
|
11 |
from fastrtc import (
|
12 |
AdditionalOutputs,
|
13 |
AsyncStreamHandler,
|
14 |
Stream,
|
15 |
get_twilio_turn_credentials,
|
16 |
)
|
17 |
+
from gradio.utils import get_space
|
|
|
18 |
from openai.types.beta.realtime import ResponseAudioTranscriptDoneEvent
|
19 |
|
20 |
load_dotenv()
|
|
|
116 |
additional_outputs=[chatbot],
|
117 |
additional_outputs_handler=update_chatbot,
|
118 |
rtc_configuration=get_twilio_turn_credentials() if get_space() else None,
|
119 |
+
concurrency_limit=20 if get_space() else None,
|
120 |
)
|
121 |
|
122 |
|
requirements.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
fastrtc
|
2 |
openai
|
3 |
twilio
|
4 |
python-dotenv
|
|
|
1 |
+
fastrtc
|
2 |
openai
|
3 |
twilio
|
4 |
python-dotenv
|