umyunsang commited on
Commit
3f5e9ae
·
1 Parent(s): 77f0193

fix: _strip_thought_blocks에 <think>...</think> 패턴 추가 (EXAONE-4.0 추론 모드 지원)

Browse files
Files changed (1) hide show
  1. src/inference/api_server.py +4 -1
src/inference/api_server.py CHANGED
@@ -381,7 +381,10 @@ class vLLMEngineManager:
381
 
382
  @staticmethod
383
  def _strip_thought_blocks(text: str) -> str:
384
- return re.sub(r"<thought>.*?</thought>\s*", "", text, flags=re.DOTALL).strip()
 
 
 
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: