From 24aa9a74bd571009dff50ce428860d78667d289a Mon Sep 17 00:00:00 2001 From: projects-g <63178974+projects-g@users.noreply.github.com> Date: Wed, 27 Sep 2023 19:20:43 +0530 Subject: [PATCH] hotfix (#254) --- server/docker-compose.yml | 1 + server/reflector/processors/transcript_topic_detector.py | 5 ++++- server/reflector/settings.py | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index f34a8e0a..374130fa 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -7,6 +7,7 @@ services: - 1250:1250 environment: LLM_URL: "${LLM_URL}" + MIN_TRANSCRIPT_LENGTH: "${MIN_TRANSCRIPT_LENGTH}" volumes: - model-cache:/root/.cache diff --git a/server/reflector/processors/transcript_topic_detector.py b/server/reflector/processors/transcript_topic_detector.py index 43bf9762..297c55a5 100644 --- a/server/reflector/processors/transcript_topic_detector.py +++ b/server/reflector/processors/transcript_topic_detector.py @@ -1,6 +1,7 @@ from reflector.llm import LLM, LLMTaskParams from reflector.processors.base import Processor from reflector.processors.types import TitleSummary, Transcript +from reflector.settings import settings class TranscriptTopicDetectorProcessor(Processor): @@ -12,7 +13,9 @@ class TranscriptTopicDetectorProcessor(Processor): OUTPUT_TYPE = TitleSummary TASK = "topic" - def __init__(self, min_transcript_length: int = 750, **kwargs): + def __init__( + self, min_transcript_length: int = int(settings.MIN_TRANSCRIPT_LENGTH), **kwargs + ): super().__init__(**kwargs) self.transcript = None self.min_transcript_length = min_transcript_length diff --git a/server/reflector/settings.py b/server/reflector/settings.py index 249661db..f42ff0a4 100644 --- a/server/reflector/settings.py +++ b/server/reflector/settings.py @@ -97,5 +97,8 @@ class Settings(BaseSettings): # Cache directory for all model storage CACHE_DIR: str = "./data" + # Min transcript length to generate topic + summary + MIN_TRANSCRIPT_LENGTH: int = 1800 + settings = Settings()