Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ def clear_submit():
|
|
21 |
def set_openai_api_key(api_key: str):
|
22 |
st.session_state["OPENAI_API_KEY"] = api_key
|
23 |
|
24 |
-
st.markdown('<h1>File GPT
|
25 |
|
26 |
# Sidebar
|
27 |
index = None
|
@@ -64,6 +64,9 @@ with st.sidebar:
|
|
64 |
except OpenAIError as e:
|
65 |
st.error(e._message)
|
66 |
|
|
|
|
|
|
|
67 |
st.write('To obtain an API Key you must create an OpenAI account at the following link: https://openai.com/api/')
|
68 |
if 'generated' not in st.session_state:
|
69 |
st.session_state['generated'] = []
|
@@ -94,4 +97,7 @@ with st.sidebar:
|
|
94 |
if st.session_state['generated']:
|
95 |
for i in range(len(st.session_state['generated'])-1, -1, -1):
|
96 |
message(st.session_state["generated"][i], key=str(i))
|
97 |
-
message(st.session_state['past'][i], is_user=True, key=str(i) + '_user')
|
|
|
|
|
|
|
|
21 |
def set_openai_api_key(api_key: str):
|
22 |
st.session_state["OPENAI_API_KEY"] = api_key
|
23 |
|
24 |
+
st.markdown('<h1>File GPT </h1>', unsafe_allow_html=True)
|
25 |
|
26 |
# Sidebar
|
27 |
index = None
|
|
|
64 |
except OpenAIError as e:
|
65 |
st.error(e._message)
|
66 |
|
67 |
+
tab1, tab2 = st.tabs(["Chat with the File", "About the Application"])
|
68 |
+
|
69 |
+
with tab1:
|
70 |
st.write('To obtain an API Key you must create an OpenAI account at the following link: https://openai.com/api/')
|
71 |
if 'generated' not in st.session_state:
|
72 |
st.session_state['generated'] = []
|
|
|
97 |
if st.session_state['generated']:
|
98 |
for i in range(len(st.session_state['generated'])-1, -1, -1):
|
99 |
message(st.session_state["generated"][i], key=str(i))
|
100 |
+
message(st.session_state['past'][i], is_user=True, key=str(i) + '_user')
|
101 |
+
|
102 |
+
with tab2:
|
103 |
+
st.write('Developed by </Shahnab>')
|