Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -66,7 +66,7 @@ class GeminiHandler(AsyncAudioVideoStreamHandler):
|
|
66 |
async def video_emit(self) -> VideoEmitType:
|
67 |
return await self.video_queue.get()
|
68 |
|
69 |
-
async def connect(self, api_key: str
|
70 |
# with open("prompt.md", "r") as file:
|
71 |
# template = file.read()
|
72 |
|
@@ -113,7 +113,7 @@ class GeminiHandler(AsyncAudioVideoStreamHandler):
|
|
113 |
if not self.args_set.is_set():
|
114 |
await self.wait_for_args()
|
115 |
if self.session is None:
|
116 |
-
asyncio.create_task(self.connect(self.latest_args[1]
|
117 |
array = await self.audio_queue.get()
|
118 |
return (self.output_sample_rate, array)
|
119 |
|
@@ -169,7 +169,7 @@ with gr.Blocks(css=css) as demo:
|
|
169 |
|
170 |
webrtc.stream(
|
171 |
GeminiHandler(),
|
172 |
-
inputs=[webrtc, api_key
|
173 |
outputs=[webrtc],
|
174 |
time_limit=90,
|
175 |
concurrency_limit=2,
|
|
|
66 |
async def video_emit(self) -> VideoEmitType:
|
67 |
return await self.video_queue.get()
|
68 |
|
69 |
+
async def connect(self, api_key: str):
|
70 |
# with open("prompt.md", "r") as file:
|
71 |
# template = file.read()
|
72 |
|
|
|
113 |
if not self.args_set.is_set():
|
114 |
await self.wait_for_args()
|
115 |
if self.session is None:
|
116 |
+
asyncio.create_task(self.connect(self.latest_args[1]))
|
117 |
array = await self.audio_queue.get()
|
118 |
return (self.output_sample_rate, array)
|
119 |
|
|
|
169 |
|
170 |
webrtc.stream(
|
171 |
GeminiHandler(),
|
172 |
+
inputs=[webrtc, api_key],
|
173 |
outputs=[webrtc],
|
174 |
time_limit=90,
|
175 |
concurrency_limit=2,
|