Separate out transcription and translation into own Modal deployments (#268)

* abstract transcript/translate into separate GPU apps

* update app names

* update transformers library version

* update env.example file
This commit is contained in:
projects-g
2023-10-13 22:01:21 +05:30
committed by GitHub
parent 6508e97bba
commit 628c69f81c
5 changed files with 246 additions and 140 deletions

View File

@@ -16,8 +16,8 @@ class TranscriptTranslatorProcessor(Processor):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.transcript_url = settings.TRANSCRIPT_URL
self.timeout = settings.TRANSCRIPT_TIMEOUT
self.translate_url = settings.TRANSLATE_URL
self.timeout = settings.TRANSLATE_TIMEOUT
self.headers = {"Authorization": f"Bearer {settings.LLM_MODAL_API_KEY}"}
async def _push(self, data: Transcript):
@@ -46,7 +46,7 @@ class TranscriptTranslatorProcessor(Processor):
async with httpx.AsyncClient() as client:
response = await retry(client.post)(
settings.TRANSCRIPT_URL + "/translate",
self.translate_url + "/translate",
headers=self.headers,
params=json_payload,
timeout=self.timeout,