Spaces:
Paused
Paused
修复bug
Browse files- toolbox.py +4 -0
toolbox.py
CHANGED
@@ -55,6 +55,10 @@ def write_results_to_file(history, file_name=None):
|
|
55 |
with open(f'./gpt_log/{file_name}', 'w', encoding = 'utf8') as f:
|
56 |
f.write('# chatGPT 分析报告\n')
|
57 |
for i, content in enumerate(history):
|
|
|
|
|
|
|
|
|
58 |
if i%2==0: f.write('## ')
|
59 |
f.write(content)
|
60 |
f.write('\n\n')
|
|
|
55 |
with open(f'./gpt_log/{file_name}', 'w', encoding = 'utf8') as f:
|
56 |
f.write('# chatGPT 分析报告\n')
|
57 |
for i, content in enumerate(history):
|
58 |
+
try: # 这个bug没找到触发条件,暂时先这样顶一下
|
59 |
+
if type(content) != str: content = str(content)
|
60 |
+
except:
|
61 |
+
continue
|
62 |
if i%2==0: f.write('## ')
|
63 |
f.write(content)
|
64 |
f.write('\n\n')
|