pedromsfaria commited on
Commit
537be5e
·
1 Parent(s): 1c22955

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -9
app.py CHANGED
@@ -64,15 +64,7 @@ def openai_create(user_input):
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
 
@@ -88,6 +80,16 @@ with block:
88
  ["Doi-me a cabeça!"],
89
  ["Tenho febre, podes ajudar?."],
90
  ],
 
 
 
 
 
 
 
 
 
 
91
  state = gr.State()
92
  clear = gr.ClearButton([message, chatbot])
93
 
 
64
  return ChatGPT_reply
65
 
66
 
67
+
 
 
 
 
 
 
 
 
68
 
69
  block = gr.Blocks(css=".gradio-container {background: url('file=fundo.jpg'); background-size: contain;}")
70
 
 
80
  ["Doi-me a cabeça!"],
81
  ["Tenho febre, podes ajudar?."],
82
  ],
83
+ def chatgpt_clone(input, history):
84
+ history = history or []
85
+ s = list(sum(history, ()))
86
+ s.append(input)
87
+ inp = ' '.join(s)
88
+ output = openai_create(inp)
89
+ history.append((input, output))
90
+ time.sleep(2)
91
+ return "", history
92
+
93
  state = gr.State()
94
  clear = gr.ClearButton([message, chatbot])
95