Spaces:
Running
Running
Update app.py
Browse files
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>(.*?)
|
119 |
|
120 |
if thinking_match:
|
121 |
-
thinking_content = thinking_match.group(
|
122 |
-
main_content = re.sub(r'<think
|
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 [
|