Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,18 +4,10 @@ from freeGPT import Client
|
|
4 |
st.title("ChatGPT4 UI")
|
5 |
cont = st.container(height=400)
|
6 |
prompt = st.chat_input(placeholder="Eg. How are you?")
|
7 |
-
num_user_msg = 0
|
8 |
-
num_ai_msg = 0
|
9 |
-
ai_msg = []
|
10 |
-
user_msg = []
|
11 |
|
12 |
if prompt:
|
13 |
-
num_user_msg += 1
|
14 |
-
num_ai_msg += 1
|
15 |
output = Client.create_completion("gpt3", prompt)
|
16 |
user_pr = cont.chat_message
|
17 |
-
|
18 |
-
user_msg[num_user_msg-1].write(prompt)
|
19 |
output_msg = cont.chat_message("assistant")
|
20 |
-
|
21 |
-
ai_msg[num_ai_msg-1].write(output)
|
|
|
4 |
st.title("ChatGPT4 UI")
|
5 |
cont = st.container(height=400)
|
6 |
prompt = st.chat_input(placeholder="Eg. How are you?")
|
|
|
|
|
|
|
|
|
7 |
|
8 |
if prompt:
|
|
|
|
|
9 |
output = Client.create_completion("gpt3", prompt)
|
10 |
user_pr = cont.chat_message
|
11 |
+
user_pr.write(prompt)
|
|
|
12 |
output_msg = cont.chat_message("assistant")
|
13 |
+
output_msg.write(output)
|
|