Spaces:
Running
Running
update
Browse files- app.py +8 -1
- app_gemini_voice.py +13 -5
app.py
CHANGED
|
@@ -67,4 +67,11 @@ demo = get_app(
|
|
| 67 |
)
|
| 68 |
|
| 69 |
if __name__ == "__main__":
|
| 70 |
-
demo.queue(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
)
|
| 68 |
|
| 69 |
if __name__ == "__main__":
|
| 70 |
+
demo.queue(
|
| 71 |
+
api_open=False,
|
| 72 |
+
max_size=20
|
| 73 |
+
).launch(
|
| 74 |
+
show_api=False,
|
| 75 |
+
share=True,
|
| 76 |
+
server_name="0.0.0.0"
|
| 77 |
+
)
|
app_gemini_voice.py
CHANGED
|
@@ -173,11 +173,22 @@ class GeminiVoiceChat:
|
|
| 173 |
</div>
|
| 174 |
""")
|
| 175 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
webrtc = WebRTC(
|
| 177 |
label="Conversation",
|
| 178 |
modality="audio",
|
| 179 |
mode="send-receive",
|
| 180 |
-
rtc_configuration=
|
| 181 |
)
|
| 182 |
|
| 183 |
webrtc.stream(
|
|
@@ -193,10 +204,7 @@ class GeminiVoiceChat:
|
|
| 193 |
self.demo.launch(
|
| 194 |
server_name="0.0.0.0",
|
| 195 |
server_port=int(os.environ.get("PORT", 7860)),
|
| 196 |
-
share=
|
| 197 |
-
ssl_verify=False,
|
| 198 |
-
ssl_keyfile=None,
|
| 199 |
-
ssl_certfile=None
|
| 200 |
)
|
| 201 |
|
| 202 |
# Create and expose the demo instance
|
|
|
|
| 173 |
</div>
|
| 174 |
""")
|
| 175 |
|
| 176 |
+
rtc_config = {
|
| 177 |
+
"iceServers": [
|
| 178 |
+
{"urls": ["stun:stun.l.google.com:19302"]}
|
| 179 |
+
]
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
try:
|
| 183 |
+
rtc_config = get_twilio_turn_credentials()
|
| 184 |
+
except Exception as e:
|
| 185 |
+
print(f"Using fallback STUN configuration: {e}")
|
| 186 |
+
|
| 187 |
webrtc = WebRTC(
|
| 188 |
label="Conversation",
|
| 189 |
modality="audio",
|
| 190 |
mode="send-receive",
|
| 191 |
+
rtc_configuration=rtc_config
|
| 192 |
)
|
| 193 |
|
| 194 |
webrtc.stream(
|
|
|
|
| 204 |
self.demo.launch(
|
| 205 |
server_name="0.0.0.0",
|
| 206 |
server_port=int(os.environ.get("PORT", 7860)),
|
| 207 |
+
share=False
|
|
|
|
|
|
|
|
|
|
| 208 |
)
|
| 209 |
|
| 210 |
# Create and expose the demo instance
|