k-mktr commited on
Commit
65a6f3b
·
verified ·
1 Parent(s): f8d0cdb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -115,11 +115,11 @@ def call_ollama_api(model, prompt):
115
  ]
116
 
117
  # Extract thinking part and main content using regex
118
- thinking_match = re.search(r'<think>(.*?)</think>', content, flags=re.DOTALL)
119
 
120
  if thinking_match:
121
- thinking_content = thinking_match.group(1).strip()
122
- main_content = re.sub(r'<think>.*?</think>', '', content, flags=re.DOTALL).strip()
123
 
124
  logger.info(f"Found thinking content for model: {model}")
125
  return [
 
115
  ]
116
 
117
  # Extract thinking part and main content using regex
118
+ thinking_match = re.search(r'<(think|thought)>(.*?)</\1>', content, flags=re.DOTALL)
119
 
120
  if thinking_match:
121
+ thinking_content = thinking_match.group(2).strip()
122
+ main_content = re.sub(r'<(think|thought)>.*?</\1>', '', content, flags=re.DOTALL).strip()
123
 
124
  logger.info(f"Found thinking content for model: {model}")
125
  return [