Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,7 +18,7 @@ from docx.enum.text import WD_ALIGN_PARAGRAPH
|
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
-
openai.api_key = "sk-
|
| 22 |
|
| 23 |
messages = []
|
| 24 |
|
|
@@ -294,14 +294,14 @@ def CustomChatGPT(user_input, uploaded_file):
|
|
| 294 |
doc.add_paragraph(ChatGPT_reply)
|
| 295 |
word_filename = "generated_response.docx"
|
| 296 |
doc.save(word_filename)
|
| 297 |
-
# pdf_filename = convert_to_pdf(word_filename)
|
| 298 |
|
| 299 |
-
|
|
|
|
| 300 |
|
| 301 |
# reset the messages to start a new conversation
|
| 302 |
messages = []
|
| 303 |
|
| 304 |
-
return ChatGPT_reply, word_filename
|
| 305 |
|
| 306 |
|
| 307 |
|
|
@@ -371,9 +371,9 @@ def main():
|
|
| 371 |
with gr.Row():
|
| 372 |
output_word = gr.File(label="下载word文件")
|
| 373 |
# output_pdf = gr.File(label="Download PDF File")
|
| 374 |
-
|
| 375 |
|
| 376 |
-
submit_btn.click(fn=CustomChatGPT, inputs=[text_input, file_input], outputs=[output_text, output_word
|
| 377 |
|
| 378 |
with gr.Row():
|
| 379 |
log_text = gr.Textbox(label="Log Content", interactive=True, lines=1)
|
|
|
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
+
openai.api_key = "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"
|
| 22 |
|
| 23 |
messages = []
|
| 24 |
|
|
|
|
| 294 |
doc.add_paragraph(ChatGPT_reply)
|
| 295 |
word_filename = "generated_response.docx"
|
| 296 |
doc.save(word_filename)
|
|
|
|
| 297 |
|
| 298 |
+
|
| 299 |
+
|
| 300 |
|
| 301 |
# reset the messages to start a new conversation
|
| 302 |
messages = []
|
| 303 |
|
| 304 |
+
return ChatGPT_reply, word_filename
|
| 305 |
|
| 306 |
|
| 307 |
|
|
|
|
| 371 |
with gr.Row():
|
| 372 |
output_word = gr.File(label="下载word文件")
|
| 373 |
# output_pdf = gr.File(label="Download PDF File")
|
| 374 |
+
|
| 375 |
|
| 376 |
+
submit_btn.click(fn=CustomChatGPT, inputs=[text_input, file_input], outputs=[output_text, output_word])
|
| 377 |
|
| 378 |
with gr.Row():
|
| 379 |
log_text = gr.Textbox(label="Log Content", interactive=True, lines=1)
|