Jorge Henao commited on
Commit
d9a4c48
·
1 Parent(s): 312fcc5

optimization fixes

Browse files
Files changed (4) hide show
  1. about.py +2 -1
  2. hallazgos.py +7 -7
  3. main_page.py +9 -1
  4. reformas.py +1 -9
about.py CHANGED
@@ -1,6 +1,7 @@
 
1
  import streamlit as st
2
 
3
- def about_ask2democracy(api_key):
4
  st.markdown("""
5
  <h1 style='
6
  text-align: center;
 
1
+ from pinecode_quieries import PinecodeProposalQueries
2
  import streamlit as st
3
 
4
+ def about_ask2democracy(api_key: str, queries: PinecodeProposalQueries = None):
5
  st.markdown("""
6
  <h1 style='
7
  text-align: center;
hallazgos.py CHANGED
@@ -11,14 +11,14 @@ logging.basicConfig(format="%(levelname)s - %(name)s - %(message)s", level=logg
11
  logging.getLogger("haystack").setLevel(logging.INFO)
12
 
13
 
14
- def hallazgos_comision_verdad_2022(api_key):
15
 
16
- queries = PinecodeProposalQueries (index_name= Config.index_name,
17
- api_key = Config.es_password,
18
- environment = Config.pinecone_environment,
19
- embedding_dim = Config.embedding_dim,
20
- reader_name_or_path = Config.reader_model_name_or_path,
21
- use_gpu = Config.use_gpu, OPENAI_key= api_key)
22
  title = """
23
  <h1 style='
24
  text-align: center;
 
11
  logging.getLogger("haystack").setLevel(logging.INFO)
12
 
13
 
14
+ def hallazgos_comision_verdad_2022(api_key: str, queries: PinecodeProposalQueries = None):
15
 
16
+ # queries = PinecodeProposalQueries (index_name= Config.index_name,
17
+ # api_key = Config.es_password,
18
+ # environment = Config.pinecone_environment,
19
+ # embedding_dim = Config.embedding_dim,
20
+ # reader_name_or_path = Config.reader_model_name_or_path,
21
+ # use_gpu = Config.use_gpu, OPENAI_key= api_key)
22
  title = """
23
  <h1 style='
24
  text-align: center;
main_page.py CHANGED
@@ -22,6 +22,14 @@ page_options = {
22
  # Define the page selector
23
  selected_page = st.sidebar.radio("Selecciona la página que deseas explorar:", list(page_options.keys()))
24
 
 
 
 
 
 
 
 
 
25
  # Render the selected page
26
  #print("key: " + api_key)
27
- page_options[selected_page](api_key)
 
22
  # Define the page selector
23
  selected_page = st.sidebar.radio("Selecciona la página que deseas explorar:", list(page_options.keys()))
24
 
25
+ queries = PinecodeProposalQueries (index_name= Config.index_name,
26
+ api_key = Config.es_password,
27
+ environment = Config.pinecone_environment,
28
+ embedding_dim = Config.embedding_dim,
29
+ reader_name_or_path = Config.reader_model_name_or_path,
30
+ use_gpu = Config.use_gpu,
31
+ OPENAI_key=api_key)
32
+
33
  # Render the selected page
34
  #print("key: " + api_key)
35
+ page_options[selected_page](api_key, queries)
reformas.py CHANGED
@@ -10,15 +10,7 @@ import logging
10
  logging.basicConfig(format="%(levelname)s - %(name)s - %(message)s", level=logging.WARNING)
11
  logging.getLogger("haystack").setLevel(logging.INFO)
12
 
13
- def reforma_salud_febrero_2023(api_key):
14
-
15
- queries = PinecodeProposalQueries (index_name= Config.index_name,
16
- api_key = Config.es_password,
17
- environment = Config.pinecone_environment,
18
- embedding_dim = Config.embedding_dim,
19
- reader_name_or_path = Config.reader_model_name_or_path,
20
- use_gpu = Config.use_gpu,
21
- OPENAI_key=api_key)
22
 
23
  title = """
24
  <h1 style='
 
10
  logging.basicConfig(format="%(levelname)s - %(name)s - %(message)s", level=logging.WARNING)
11
  logging.getLogger("haystack").setLevel(logging.INFO)
12
 
13
+ def reforma_salud_febrero_2023(api_key: str, queries: PinecodeProposalQueries = None):
 
 
 
 
 
 
 
 
14
 
15
  title = """
16
  <h1 style='