From 8b0a7e45acad54d14c4e49523805951ad01691aa Mon Sep 17 00:00:00 2001 From: hbyang Date: Mon, 10 Aug 2026 16:15:36 +0900 Subject: [PATCH] =?UTF-8?q?CPU=20=EB=B0=B0=ED=8F=AC=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=EC=97=90=EC=84=9C=20CUDA=20=EC=9D=98=EC=A1=B4?= =?UTF-8?q?=EC=84=B1=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 3 ++- app/core/config.py | 2 +- docs/IMPLEMENTATION_RUNBOOK.md | 7 +++++++ requirements.txt | 1 - 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index cc0bb23..8e4563f 100644 --- a/.env.example +++ b/.env.example @@ -31,7 +31,8 @@ AI_DETECTOR_USE_POS=true SIMILARITY_THRESHOLD=0.85 # KoSimCSE / KoSBERT (PDF VII-3 권장 - 한국어 오픈소스 임베딩, 자체 산출물) -USE_KOSIMCSE=true +# CPU 기본 이미지는 torch를 포함하지 않습니다. 레거시 KoSimCSE를 별도 설치한 경우만 true. +USE_KOSIMCSE=false KOSIMCSE_MODEL=BM-K/KoSimCSE-roberta-multitask KOSIMCSE_MAX_LENGTH=512 diff --git a/app/core/config.py b/app/core/config.py index 3598f78..c77c3c0 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -35,7 +35,7 @@ class Settings(BaseSettings): similarity_threshold: float = 0.85 # KoSimCSE / KoSBERT (PDF VII-3 권장) - 한국어 오픈소스 임베딩 - use_kosimcse: bool = True + use_kosimcse: bool = False kosimcse_model: str = "BM-K/KoSimCSE-roberta-multitask" kosimcse_max_length: int = 512 diff --git a/docs/IMPLEMENTATION_RUNBOOK.md b/docs/IMPLEMENTATION_RUNBOOK.md index 40f6ab5..96ca605 100644 --- a/docs/IMPLEMENTATION_RUNBOOK.md +++ b/docs/IMPLEMENTATION_RUNBOOK.md @@ -120,3 +120,10 @@ python -m scripts.validate_precedents data/precedents/precedents.jsonl Ubuntu 18.04는 지원 종료 상태이므로 OS 업그레이드 전까지 외부 공개 범위를 최소화하고, API 인증·방화벽·키 회전을 별도 운영 작업으로 완료해야 한다. + +## 선택적 KoSimCSE + +기본 CPU 이미지는 새 영속 문자 인덱스를 사용하며 `torch`와 `sentence-transformers`를 +포함하지 않는다. 일반 PyPI의 최신 torch가 CUDA 런타임 수 GB를 함께 설치할 수 있기 +때문이다. 레거시 KoSimCSE가 반드시 필요한 별도 이미지에서만 해당 Python 버전에 맞는 +공식 CPU 전용 torch wheel을 먼저 설치한 뒤 sentence-transformers를 추가한다. diff --git a/requirements.txt b/requirements.txt index 45bd908..d9cf133 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,6 @@ openai>=1.55 httpx>=0.27 kiwipiepy>=0.18 datasketch>=1.6 -sentence-transformers>=3.0 openpyxl>=3.1 joblib>=1.4 scipy>=1.13