Spaces:
Sleeping
Sleeping
Commit
·
fb9db04
1
Parent(s):
0041579
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,7 +64,15 @@ def openai_create(user_input):
|
|
| 64 |
return ChatGPT_reply
|
| 65 |
|
| 66 |
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
block = gr.Blocks(css=".gradio-container {background: url('file=fundo.jpg'); background-size: contain;}")
|
| 70 |
|
|
@@ -83,15 +91,7 @@ with block:
|
|
| 83 |
state = gr.State()
|
| 84 |
clear = gr.ClearButton([message, chatbot])
|
| 85 |
|
| 86 |
-
|
| 87 |
-
history = history or []
|
| 88 |
-
s = list(sum(history, ()))
|
| 89 |
-
s.append(input)
|
| 90 |
-
inp = ' '.join(s)
|
| 91 |
-
output = openai_create(inp)
|
| 92 |
-
history.append((input, output))
|
| 93 |
-
time.sleep(2)
|
| 94 |
-
return "", history
|
| 95 |
|
| 96 |
message.submit(chatgpt_clone, inputs=[message, chatbot], outputs=[message, chatbot])
|
| 97 |
|
|
|
|
| 64 |
return ChatGPT_reply
|
| 65 |
|
| 66 |
|
| 67 |
+
def chatgpt_clone(input, history):
|
| 68 |
+
history = history or []
|
| 69 |
+
s = list(sum(history, ()))
|
| 70 |
+
s.append(input)
|
| 71 |
+
inp = ' '.join(s)
|
| 72 |
+
output = openai_create(inp)
|
| 73 |
+
history.append((input, output))
|
| 74 |
+
time.sleep(2)
|
| 75 |
+
return "", history
|
| 76 |
|
| 77 |
block = gr.Blocks(css=".gradio-container {background: url('file=fundo.jpg'); background-size: contain;}")
|
| 78 |
|
|
|
|
| 91 |
state = gr.State()
|
| 92 |
clear = gr.ClearButton([message, chatbot])
|
| 93 |
|
| 94 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
|
| 96 |
message.submit(chatgpt_clone, inputs=[message, chatbot], outputs=[message, chatbot])
|
| 97 |
|