Spaces:
Runtime error
Runtime error
Commit
Β·
5f40d23
1
Parent(s):
5e49ced
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,7 +22,7 @@ openai.api_key = "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"
|
|
| 22 |
start_sequence = "\nAI:"
|
| 23 |
restart_sequence = "\nHuman: "
|
| 24 |
|
| 25 |
-
prompt = "
|
| 26 |
|
| 27 |
def openai_create(prompt):
|
| 28 |
|
|
@@ -64,7 +64,9 @@ with gr.Blocks() as demo:
|
|
| 64 |
message = gr.Textbox(placeholder=prompt)
|
| 65 |
state = gr.State()
|
| 66 |
submit = gr.Button("SEND")
|
|
|
|
| 67 |
submit.click(chatgpt_clone, inputs=[message, state], outputs=[chatbot, state])
|
|
|
|
| 68 |
|
| 69 |
|
| 70 |
demo.launch(inline=False)
|
|
|
|
| 22 |
start_sequence = "\nAI:"
|
| 23 |
restart_sequence = "\nHuman: "
|
| 24 |
|
| 25 |
+
prompt = "You can discuss any topic with the Chatbot assistant in Chinese by typing it in here"
|
| 26 |
|
| 27 |
def openai_create(prompt):
|
| 28 |
|
|
|
|
| 64 |
message = gr.Textbox(placeholder=prompt)
|
| 65 |
state = gr.State()
|
| 66 |
submit = gr.Button("SEND")
|
| 67 |
+
reset = gr.Button("RESET")
|
| 68 |
submit.click(chatgpt_clone, inputs=[message, state], outputs=[chatbot, state])
|
| 69 |
+
reset.click(reset_chatbot, inputs=[message, chatbot])
|
| 70 |
|
| 71 |
|
| 72 |
demo.launch(inline=False)
|