Spaces:
Sleeping
Sleeping
v444
Browse files
app.py
CHANGED
@@ -51,13 +51,13 @@ def convert(res,openai_key):
|
|
51 |
answer = ''
|
52 |
for txt_line in split_list(content,20):
|
53 |
txt_line_content = '\n'.join(txt_line)
|
54 |
-
prompt = f"
|
55 |
open_ai_res = create(prompt,openai_key)
|
56 |
-
answer += open_ai_res['choices'][0]['text']
|
57 |
except Exception as e:
|
58 |
print('open ai api error',e)
|
59 |
|
60 |
-
res_content = f'
|
61 |
|
62 |
return res_content
|
63 |
|
|
|
51 |
answer = ''
|
52 |
for txt_line in split_list(content,20):
|
53 |
txt_line_content = '\n'.join(txt_line)
|
54 |
+
prompt = f"将下面的内容使用简体中文总结5条要点出来:\n\n{txt_line_content}"
|
55 |
open_ai_res = create(prompt,openai_key)
|
56 |
+
answer += prompt + '\n GPT3:\n' + open_ai_res['choices'][0]['text']
|
57 |
except Exception as e:
|
58 |
print('open ai api error',e)
|
59 |
|
60 |
+
res_content = f'{answer}'
|
61 |
|
62 |
return res_content
|
63 |
|