Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -619,9 +619,11 @@ class GrokApiClient:
|
|
619 |
search = request_data["model"] in ["grok-2-search", "grok-3-search"]
|
620 |
|
621 |
def remove_think_tags(text):
|
622 |
-
|
623 |
-
|
624 |
-
|
|
|
|
|
625 |
image
|
626 |
$$$data:.*?base64,.*?$', '[图片]', text)
|
627 |
return text
|
|
|
619 |
search = request_data["model"] in ["grok-2-search", "grok-3-search"]
|
620 |
|
621 |
def remove_think_tags(text):
|
622 |
+
import re
|
623 |
+
text = re.sub(r'<think>[\s\S]*?<\/think>', '', text).strip()
|
624 |
+
text = re.sub(r'!\[image\]\(data:.*?base64,.*?\)', '[图片]', text)
|
625 |
+
return text
|
626 |
+
|
627 |
image
|
628 |
$$$data:.*?base64,.*?$', '[图片]', text)
|
629 |
return text
|