Spaces:
Sleeping
Sleeping
Commit ·
f672c4e
1
Parent(s): 0ed187b
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,22 +1,12 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from freeGPT import Client
|
| 3 |
|
| 4 |
-
|
| 5 |
-
def get_response(user_input):
|
| 6 |
-
try:
|
| 7 |
-
response = client.create_completion("gpt3", user_input)
|
| 8 |
-
except Exception as e:
|
| 9 |
-
return "Error: {}".format(str(e))
|
| 10 |
-
else:
|
| 11 |
-
with st.chat_message("User"):
|
| 12 |
-
st.write(user_input)
|
| 13 |
-
with st.chat_message("KviGPT"):
|
| 14 |
-
st.write(response)
|
| 15 |
|
| 16 |
-
st.
|
| 17 |
-
st.sidebar.subheader("Chat based on Gpt-3")
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from freeGPT import Client
|
| 3 |
|
| 4 |
+
st.title("KviGPT")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
user_input = st.chat_input("👦: ")
|
|
|
|
| 7 |
|
| 8 |
+
try:
|
| 9 |
+
resp = Client.create_completion("gpt3", user_input)
|
| 10 |
+
st.chat_message(f"🤖: {resp}")
|
| 11 |
+
except Exception as e:
|
| 12 |
+
st.chat_message(f"🤖: {e}")
|