getapi commited on
Commit
24b20ec
·
1 Parent(s): e463f93

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -13
app.py CHANGED
@@ -22,25 +22,18 @@ safety_settings = [
22
  },
23
  ]
24
 
25
- if "authenticated" not in st.session_state:
26
- st.session_state["authenticated"] = False
27
 
28
- if not st.session_state["authenticated"]:
29
- password = st.text_input("пасскод", type="password")
 
 
 
30
 
31
- if password == st.secrets["real_password"]:
32
- st.session_state["authenticated"] = True
33
- st.success("успех")
34
- elif password:
35
- st.warning("неудача")
36
- else:
37
  with st.sidebar:
38
  st.title("Gemini Pro")
39
 
40
  genai.configure(api_key=st.secrets["api_key"])
41
 
42
-
43
-
44
  uploaded_image = st.file_uploader(
45
  label="загрузи изображение",
46
  label_visibility="visible",
@@ -91,4 +84,5 @@ else:
91
  res_area.markdown(res_text)
92
 
93
  messages.append({"role": "model", "parts": [res_text]})
94
-
 
 
22
  },
23
  ]
24
 
 
 
25
 
26
+ password_placeholder = st.empty()
27
+ password = password_placeholder.text_input("пасскод", type="password")
28
+ if password == st.secrets["real_password"]:
29
+ password_placeholder.empty()
30
+ st.success("тебе позволено войти, хорошо")
31
 
 
 
 
 
 
 
32
  with st.sidebar:
33
  st.title("Gemini Pro")
34
 
35
  genai.configure(api_key=st.secrets["api_key"])
36
 
 
 
37
  uploaded_image = st.file_uploader(
38
  label="загрузи изображение",
39
  label_visibility="visible",
 
84
  res_area.markdown(res_text)
85
 
86
  messages.append({"role": "model", "parts": [res_text]})
87
+ else:
88
+ st.warning("неправильный пароль, увы...")