Kvikontent commited on
Commit
6f43702
·
verified ·
1 Parent(s): 192b917

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from freeGPT import Client
3
+
4
+ st.title("ChatGPT4 UI")
5
+ cont = st.conteainer(height=400)
6
+ prompt = cont.chat_message(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
+ user_msg.append(user_pr)
18
+ user_msg[num_user_msg].write(prompt)
19
+ output_msg = cont.chat_message("assistant")
20
+ ai_msg.append(output_msg)
21
+ ai_msg[num_ai_msg].write(output)