Spaces:
Paused
Paused
fix: _strip_thought_blocks에 <think>...</think> 패턴 추가 (EXAONE-4.0 추론 모드 지원)
Browse files
src/inference/api_server.py
CHANGED
|
@@ -381,7 +381,10 @@ class vLLMEngineManager:
|
|
| 381 |
|
| 382 |
@staticmethod
|
| 383 |
def _strip_thought_blocks(text: str) -> str:
|
| 384 |
-
|
|
|
|
|
|
|
|
|
|
| 385 |
|
| 386 |
def _build_rag_context(self, retrieved_cases: List[dict]) -> str:
|
| 387 |
if not retrieved_cases:
|
|
|
|
| 381 |
|
| 382 |
@staticmethod
|
| 383 |
def _strip_thought_blocks(text: str) -> str:
|
| 384 |
+
# <thought>...</thought> (구형) 및 <think>...</think> (EXAONE-4.0 추론 모드) 모두 제거
|
| 385 |
+
text = re.sub(r"<thought>.*?</thought>\s*", "", text, flags=re.DOTALL)
|
| 386 |
+
text = re.sub(r"<think>.*?</think>\s*", "", text, flags=re.DOTALL)
|
| 387 |
+
return text.strip()
|
| 388 |
|
| 389 |
def _build_rag_context(self, retrieved_cases: List[dict]) -> str:
|
| 390 |
if not retrieved_cases:
|