Jorge Henao commited on
Commit
b5513fe
1 Parent(s): 24972a7

session removed for api_key

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -107,9 +107,9 @@ def main():
107
  Creado por Jorge Henao 🇨🇴 <a href="https://twitter.com/jhenaotw" target='_blank'>Twitter</a> <a href="https://www.linkedin.com/in/henaojorge" target='_blank'>LinkedIn</a> <a href="https://linktr.ee/jorgehenao" target='_blank'>Linktree</a>
108
  </div>""", unsafe_allow_html=True)
109
 
110
- session_state = st.session_state
111
- if "api_key" not in session_state:
112
- session_state.api_key = ""
113
 
114
  with st.form("my_form"):
115
  st.sidebar.title("Configuración de búsqueda")
@@ -120,14 +120,13 @@ def main():
120
 
121
  with st.sidebar.expander("Configuración OpenAI"):
122
  openai_api_key = st.text_input("API Key", type="password", placeholder="Copia aquí tu OpenAI API key (no será guardada)",
123
- help="puedes obtener tu api key de OpenAI en https://platform.openai.com/account/api-keys.",
124
- value= session_state.api_key)
125
  openai_api_model = st.text_input("Modelo", value= "text-davinci-003")
126
  openai_api_temp = st.slider("Temperatura", 0.1, 1.0, 0.5, step=0.1)
127
  openai_api_max_tokens = st.slider("Max tokens", 10, 100, 60, step=10)
128
 
129
- if openai_api_key:
130
- session_state.password = openai_api_key
131
 
132
  sample_questions = get_samples_for_index(index).splitlines()
133
  query = st.text_area("",placeholder="Escribe aquí tu pregunta, cuanto más contexto le des, mejor serán las respuestas")
 
107
  Creado por Jorge Henao 🇨🇴 <a href="https://twitter.com/jhenaotw" target='_blank'>Twitter</a> <a href="https://www.linkedin.com/in/henaojorge" target='_blank'>LinkedIn</a> <a href="https://linktr.ee/jorgehenao" target='_blank'>Linktree</a>
108
  </div>""", unsafe_allow_html=True)
109
 
110
+ # session_state = st.session_state
111
+ # if "api_key" not in session_state:
112
+ # session_state.api_key = ""
113
 
114
  with st.form("my_form"):
115
  st.sidebar.title("Configuración de búsqueda")
 
120
 
121
  with st.sidebar.expander("Configuración OpenAI"):
122
  openai_api_key = st.text_input("API Key", type="password", placeholder="Copia aquí tu OpenAI API key (no será guardada)",
123
+ help="puedes obtener tu api key de OpenAI en https://platform.openai.com/account/api-keys.")
 
124
  openai_api_model = st.text_input("Modelo", value= "text-davinci-003")
125
  openai_api_temp = st.slider("Temperatura", 0.1, 1.0, 0.5, step=0.1)
126
  openai_api_max_tokens = st.slider("Max tokens", 10, 100, 60, step=10)
127
 
128
+ # if openai_api_key:
129
+ # session_state.password = openai_api_key
130
 
131
  sample_questions = get_samples_for_index(index).splitlines()
132
  query = st.text_area("",placeholder="Escribe aquí tu pregunta, cuanto más contexto le des, mejor serán las respuestas")