dipta007 commited on
Commit
a742296
1 Parent(s): 69e0201

added password for security

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -47,6 +47,9 @@ def share():
47
 
48
  with st.sidebar:
49
  st.title(":blue[ChatGPT with Vision]")
 
 
 
50
  if st.button("Share", use_container_width=True):
51
  share()
52
 
@@ -126,6 +129,9 @@ def push_message(role, content, images=None):
126
  return message
127
 
128
  if prompt := st.chat_input("Type a message", key="chat_input"):
 
 
 
129
  push_message("user", prompt, images)
130
  with st.chat_message("user"):
131
  st.markdown(prompt)
 
47
 
48
  with st.sidebar:
49
  st.title(":blue[ChatGPT with Vision]")
50
+
51
+ password = st.text_input("Password", type="password")
52
+
53
  if st.button("Share", use_container_width=True):
54
  share()
55
 
 
129
  return message
130
 
131
  if prompt := st.chat_input("Type a message", key="chat_input"):
132
+ if password != st.secrets["PASSWORD"]:
133
+ st.error("Invalid password. Demo is read-only.")
134
+ st.stop()
135
  push_message("user", prompt, images)
136
  with st.chat_message("user"):
137
  st.markdown(prompt)