Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,9 +29,9 @@ def remove_think_tags(content):
|
|
| 29 |
# cleaned_content = re.sub(pattern, '', content, flags=re.DOTALL)
|
| 30 |
|
| 31 |
# 刪除所有 <think> 標籤及其內容
|
| 32 |
-
|
| 33 |
# 清除殘留空行 (連續兩個以上換行符)
|
| 34 |
-
|
| 35 |
|
| 36 |
return cleaned_content.strip()
|
| 37 |
|
|
|
|
| 29 |
# cleaned_content = re.sub(pattern, '', content, flags=re.DOTALL)
|
| 30 |
|
| 31 |
# 刪除所有 <think> 標籤及其內容
|
| 32 |
+
cleaned_content = re.sub(r'<\s*think[^>]*>.*?<\s*/\s*think\s*>', '', content, flags=re.DOTALL)
|
| 33 |
# 清除殘留空行 (連續兩個以上換行符)
|
| 34 |
+
cleaned_content = re.sub(r'\n{3,}', '\n\n', cleaned_content)
|
| 35 |
|
| 36 |
return cleaned_content.strip()
|
| 37 |
|