File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -252,9 +252,9 @@ def predict_no_ui_long_connection(
252
252
logger .error (error_msg )
253
253
raise RuntimeError ("Json解析不合常规" )
254
254
if reasoning :
255
- return f'''<div style=" padding: 1em; line-height: 1.5; text-wrap: wrap; opacity: 0.8">
256
- { '' .join ([f'<p style="margin: 1.25em 0;">{ line } </p>' for line in reasoning_buffer .split ('\n ' )])}
257
- </div>\n \n ''' + result
255
+ style = ' padding: 1em; line-height: 1.5; text-wrap: wrap; opacity: 0.8'
256
+ paragraphs = '' .join ([f'<p style="margin: 1.25em 0;">{ line } </p>' for line in reasoning_buffer .split ('\n ' )])
257
+ return f'''<div style=" { style } "> { paragraphs } </div>\n \n ''' + result
258
258
return result
259
259
260
260
def predict (
@@ -390,9 +390,9 @@ def predict(
390
390
if reasoning :
391
391
gpt_replying_buffer += response_text
392
392
gpt_reasoning_buffer += reasoning_content
393
- history [ - 1 ] = f'''<div style=" padding: 1em; line-height: 1.5; text-wrap: wrap; opacity: 0.8">
394
- { '' .join ([f'<p style="margin: 1.25em 0;">{ line } </p>' for line in gpt_reasoning_buffer .split ('\n ' )])}
395
- < /div>\n \n '' ' + gpt_replying_buffer
393
+ style = ' padding: 1em; line-height: 1.5; text-wrap: wrap; opacity: 0.8'
394
+ paragraphs = '' .join ([f'<p style="margin: 1.25em 0;">{ line } </p>' for line in gpt_reasoning_buffer .split ('\n ' )])
395
+ history [ - 1 ] = f'<div style=" { style } "> { paragraphs } < /div>\n \n ' + gpt_replying_buffer
396
396
else :
397
397
gpt_replying_buffer += response_text
398
398
# 如果这里抛出异常,一般是文本过长,详情见get_full_error的输出
You can’t perform that action at this time.
0 commit comments