update server to run summarizer and captions

This commit is contained in:
Gokul Mohanarangan
2023-07-18 22:36:35 +05:30
parent 20eaeee46b
commit e5aa943998
3 changed files with 41 additions and 18 deletions

View File

@@ -11,10 +11,7 @@ from aiortc import (RTCPeerConnection, RTCSessionDescription)
from aiortc.contrib.media import (MediaPlayer, MediaRelay)
from utils.log_utils import logger
from utils.run_utils import config, Mutex
file_lock = Mutex(open("test_sm_6.txt", "a"))
from utils.run_utils import config
class StreamClient:
def __init__(
@@ -146,10 +143,7 @@ class StreamClient:
async def worker(self, name, queue):
while True:
msg = await self.queue.get()
msg = ast.literal_eval(msg)
with file_lock.lock() as file:
file.write(msg["text"])
yield msg["text"]
yield msg
self.queue.task_done()
async def start(self):