Spaces:
Sleeping
Sleeping
Move re import to top of file
Browse files
llm_clients/qwen_translator.py
CHANGED
|
@@ -7,6 +7,7 @@ import tempfile
|
|
| 7 |
import zipfile
|
| 8 |
import urllib.request
|
| 9 |
import shutil
|
|
|
|
| 10 |
from pathlib import Path
|
| 11 |
from .base import LlmClient
|
| 12 |
|
|
@@ -400,7 +401,6 @@ class QwenTranslatorClient(LlmClient):
|
|
| 400 |
print(f" Raw output (first 200 chars): {output[:200]}", flush=True)
|
| 401 |
|
| 402 |
# Remove reasoning/thinking tags and their content (Qwen models sometimes output these)
|
| 403 |
-
import re
|
| 404 |
# Remove <think>...</think> tags and content
|
| 405 |
output = re.sub(r'<think>.*?</think>', '', output, flags=re.DOTALL)
|
| 406 |
# Remove <thinking>...</thinking> tags if present
|
|
|
|
| 7 |
import zipfile
|
| 8 |
import urllib.request
|
| 9 |
import shutil
|
| 10 |
+
import re
|
| 11 |
from pathlib import Path
|
| 12 |
from .base import LlmClient
|
| 13 |
|
|
|
|
| 401 |
print(f" Raw output (first 200 chars): {output[:200]}", flush=True)
|
| 402 |
|
| 403 |
# Remove reasoning/thinking tags and their content (Qwen models sometimes output these)
|
|
|
|
| 404 |
# Remove <think>...</think> tags and content
|
| 405 |
output = re.sub(r'<think>.*?</think>', '', output, flags=re.DOTALL)
|
| 406 |
# Remove <thinking>...</thinking> tags if present
|