mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
server: remove warmup methods everywhere
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
from time import monotonic
|
||||
|
||||
import httpx
|
||||
from reflector.processors.base import Processor
|
||||
from reflector.processors.types import Transcript, TranslationLanguages
|
||||
@@ -22,22 +20,6 @@ class TranscriptTranslatorProcessor(Processor):
|
||||
self.timeout = settings.TRANSCRIPT_TIMEOUT
|
||||
self.headers = {"Authorization": f"Bearer {settings.LLM_MODAL_API_KEY}"}
|
||||
|
||||
async def _warmup(self):
|
||||
try:
|
||||
async with httpx.AsyncClient() as client:
|
||||
start = monotonic()
|
||||
self.logger.debug("Translate modal: warming up...")
|
||||
response = await client.post(
|
||||
settings.TRANSCRIPT_URL + "/warmup",
|
||||
headers=self.headers,
|
||||
timeout=self.timeout,
|
||||
)
|
||||
response.raise_for_status()
|
||||
duration = monotonic() - start
|
||||
self.logger.debug(f"Translate modal: warmup took {duration:.2f}s")
|
||||
except Exception:
|
||||
self.logger.exception("Translate modal: warmup failed")
|
||||
|
||||
async def _push(self, data: Transcript):
|
||||
self.transcript = data
|
||||
await self.flush()
|
||||
|
||||
Reference in New Issue
Block a user