segoedu commited on
Commit
aa3c0ec
1 Parent(s): 9c8bb20

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -13,7 +13,7 @@ st.header("Pregunta al trebep")
13
 
14
 
15
  @st.cache_resource
16
- def incializar():
17
  # CARGAMOS LLM
18
  os.environ["GROQ_API_KEY"] = "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"
19
  model = 'llama3-8b-8192'
@@ -38,6 +38,8 @@ def incializar():
38
  #verbose=True
39
  )
40
 
 
 
41
  # Función para mostrar logs
42
  def mostrar_logs(logs,hints):
43
  # Crear un contenedor desplegable
@@ -59,7 +61,7 @@ user_question = st.text_input("¡A jugar! Haz una pregunta al trebep:")
59
  if user_question:
60
 
61
  # Inicializar entorno
62
- incializar()
63
 
64
  # Obtenemos la respuesta
65
  respuesta = qa.invoke(user_question)
 
13
 
14
 
15
  @st.cache_resource
16
+ def consultar():
17
  # CARGAMOS LLM
18
  os.environ["GROQ_API_KEY"] = "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"
19
  model = 'llama3-8b-8192'
 
38
  #verbose=True
39
  )
40
 
41
+ return qa
42
+
43
  # Función para mostrar logs
44
  def mostrar_logs(logs,hints):
45
  # Crear un contenedor desplegable
 
61
  if user_question:
62
 
63
  # Inicializar entorno
64
+ qa = consultar()
65
 
66
  # Obtenemos la respuesta
67
  respuesta = qa.invoke(user_question)