Spaces:
Sleeping
Sleeping
Commit
·
08a9b60
1
Parent(s):
3e13a7d
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
-
from
|
3 |
|
4 |
-
@st.
|
5 |
def get_response(user_input):
|
6 |
try:
|
7 |
response = client.create_completion("gpt3", user_input)
|
@@ -10,6 +10,10 @@ def get_response(user_input):
|
|
10 |
except Exception as e:
|
11 |
return "Error: {}".format(str(e))
|
12 |
|
13 |
-
st.sidebar.title("KviGPT"
|
14 |
st.sidebar.subheader("Chat based on Gpt-3")
|
15 |
-
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
+
from freegpt import Client
|
3 |
|
4 |
+
@st.cache(ttl=3600)
|
5 |
def get_response(user_input):
|
6 |
try:
|
7 |
response = client.create_completion("gpt3", user_input)
|
|
|
10 |
except Exception as e:
|
11 |
return "Error: {}".format(str(e))
|
12 |
|
13 |
+
st.sidebar.title("KviGPT")
|
14 |
st.sidebar.subheader("Chat based on Gpt-3")
|
15 |
+
|
16 |
+
user_input = st.chat_input("Say something")
|
17 |
+
|
18 |
+
if user_input:
|
19 |
+
get_response(user_input)
|