aicodingfun commited on
Commit
12bfc9d
·
verified ·
1 Parent(s): 50632e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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
- content = re.sub(r'<\s*think[^>]*>.*?<\s*/\s*think\s*>', '', content, flags=re.DOTALL)
33
  # 清除殘留空行 (連續兩個以上換行符)
34
- content = re.sub(r'\n{3,}', '\n\n', content)
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