elia-waefler commited on
Commit
9338c7b
·
1 Parent(s): 3396745

more secure login

Browse files
Files changed (1) hide show
  1. app.py +14 -5
app.py CHANGED
@@ -1,3 +1,5 @@
 
 
1
  import streamlit as st
2
  import os
3
  # import openai
@@ -104,12 +106,20 @@ def main():
104
  st.write("Text Beschreibung wird von AI hinzugefügt")
105
  st.write("jpg, bilder, tabellen, .xlsx, .docx alles möglich, nicht nur PDF/Text")
106
  st.write("Ecodomus API einbinden, um alle Dokumente zu überprüfen.")
 
 
 
 
 
 
 
 
 
107
 
108
- if st.text_input("ASK_ASH_PASSWORD: ", type="password") == ASK_ASH_PASSWORD:
109
- uploaded_files = st.file_uploader("PDF Dokument", accept_multiple_files=True)
110
- #print(uploaded_file)
111
- #print(uploaded_file.name)
112
 
 
113
  if st.button("classify KBOB!"):
114
  if uploaded_files is not None:
115
  with st.container():
@@ -125,7 +135,6 @@ def main():
125
  with col3:
126
  st.write("Geschoss")
127
  st.write(f"")
128
-
129
  for file in uploaded_files:
130
  metadata = [file.name]
131
  with col1:
 
1
+ import time
2
+
3
  import streamlit as st
4
  import os
5
  # import openai
 
106
  st.write("Text Beschreibung wird von AI hinzugefügt")
107
  st.write("jpg, bilder, tabellen, .xlsx, .docx alles möglich, nicht nur PDF/Text")
108
  st.write("Ecodomus API einbinden, um alle Dokumente zu überprüfen.")
109
+ if "login" not in st.session_state:
110
+ st.session_state.login = False
111
+
112
+ user_pw = st.text_input("ASK_ASH_PASSWORD: ", type="password")
113
+ if st.button("check"):
114
+ time.sleep(1)
115
+ if user_pw == ASK_ASH_PASSWORD:
116
+ st.session_state.login = True
117
+ uploaded_files = st.file_uploader("PDF Dokument", accept_multiple_files=True)
118
 
119
+ #print(uploaded_file)
120
+ #print(uploaded_file.name)
 
 
121
 
122
+ if st.session_state.login:
123
  if st.button("classify KBOB!"):
124
  if uploaded_files is not None:
125
  with st.container():
 
135
  with col3:
136
  st.write("Geschoss")
137
  st.write(f"")
 
138
  for file in uploaded_files:
139
  metadata = [file.name]
140
  with col1: