Spaces:
Running
Running
melihunsal
commited on
Commit
·
149436b
1
Parent(s):
b5f6ee9
sidebar added
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ st.markdown(
|
|
18 |
)
|
19 |
# Text input
|
20 |
|
21 |
-
openai_api_key = st.text_input('
|
22 |
demo_title = st.text_input('Enter your demo title', placeholder='Type your demo title')
|
23 |
|
24 |
st.write("Examples")
|
@@ -49,13 +49,13 @@ for col,example in zip(cols2,examples2):
|
|
49 |
st.markdown('----')
|
50 |
if st.session_state['current']:
|
51 |
with st.container():
|
52 |
-
if not openai_api_key:
|
53 |
-
st.warning('Please enter your OpenAI API
|
54 |
else:
|
55 |
-
if pressed:
|
56 |
wait()
|
57 |
st.session_state['done'] = st.success('Done!')
|
58 |
example2pages[st.session_state['current']](openai_api_key,demo_title)
|
59 |
st.markdown('----')
|
60 |
REPO_URL = "https://github.com/melih-unsal/DemoGPT"
|
61 |
-
st.markdown(f"
|
|
|
18 |
)
|
19 |
# Text input
|
20 |
|
21 |
+
openai_api_key = st.sidebar.text_input('OpenAI API Key', placeholder='sk-...',type="password")
|
22 |
demo_title = st.text_input('Enter your demo title', placeholder='Type your demo title')
|
23 |
|
24 |
st.write("Examples")
|
|
|
49 |
st.markdown('----')
|
50 |
if st.session_state['current']:
|
51 |
with st.container():
|
52 |
+
if not openai_api_key.startswith('sk-'):
|
53 |
+
st.warning('Please enter your OpenAI API key!', icon='⚠')
|
54 |
else:
|
55 |
+
if pressed and openai_api_key.startswith('sk-'):
|
56 |
wait()
|
57 |
st.session_state['done'] = st.success('Done!')
|
58 |
example2pages[st.session_state['current']](openai_api_key,demo_title)
|
59 |
st.markdown('----')
|
60 |
REPO_URL = "https://github.com/melih-unsal/DemoGPT"
|
61 |
+
st.markdown(f"Project [repo on github]({REPO_URL}) waiting for your :star:")
|