Spaces:
Running
Running
临时修复超链接显示为公式的问题
Browse files
request_llm/bridge_newbing.py
CHANGED
@@ -24,7 +24,7 @@ from multiprocessing import Process, Pipe
|
|
24 |
|
25 |
def preprocess_newbing_out(s):
|
26 |
pattern = r'\^(\d+)\^' # 匹配^数字^
|
27 |
-
sub = lambda m: '
|
28 |
result = re.sub(pattern, sub, s) # 替换操作
|
29 |
if '[1]' in result:
|
30 |
result += '\n\n```reference\n' + "\n".join([r for r in result.split('\n') if r.startswith('[')]) + '\n```\n'
|
|
|
24 |
|
25 |
def preprocess_newbing_out(s):
|
26 |
pattern = r'\^(\d+)\^' # 匹配^数字^
|
27 |
+
sub = lambda m: '('+m.group(1)+')' # 将匹配到的数字作为替换值
|
28 |
result = re.sub(pattern, sub, s) # 替换操作
|
29 |
if '[1]' in result:
|
30 |
result += '\n\n```reference\n' + "\n".join([r for r in result.split('\n') if r.startswith('[')]) + '\n```\n'
|