coulibaly-b commited on
Commit
8758db2
1 Parent(s): 240310d

llm setting

Browse files
AI_generator.py CHANGED
@@ -80,7 +80,7 @@ class SqlToPlotlyStreamlit:
80
  return [first_prompt, second_prompt, third_prompt, fourth_prompt]
81
 
82
  @staticmethod
83
- def generate_anwers() -> list:
84
  first_prompt, second_prompt, third_prompt, fourth_prompt = (
85
  SqlToPlotlyStreamlit.chat_prompt_template()
86
  )
@@ -165,7 +165,7 @@ class SqlToPlotlyStreamlit:
165
 
166
  try:
167
  overall_chain = SequentialChain(
168
- chains=list(SqlToPlotlyStreamlit.generate_anwers()),
169
  input_variables=["schema", "question"],
170
  output_variables=["query", "python_graph", "json"],
171
  verbose=True,
@@ -182,8 +182,6 @@ class SqlToPlotlyStreamlit:
182
  error_occurred = True
183
 
184
  if not error_occurred:
185
- # st.write("## Generated Query")
186
- # st.code(result["json"].split("```sql")[-1].split("```")[0].replace("```", ""))
187
  st.write("## Generated Python")
188
  st.code(self.generated_python_code)
189
 
 
80
  return [first_prompt, second_prompt, third_prompt, fourth_prompt]
81
 
82
  @staticmethod
83
+ def generate_anwers(llm) -> list:
84
  first_prompt, second_prompt, third_prompt, fourth_prompt = (
85
  SqlToPlotlyStreamlit.chat_prompt_template()
86
  )
 
165
 
166
  try:
167
  overall_chain = SequentialChain(
168
+ chains=list(SqlToPlotlyStreamlit.generate_anwers(self.llm)),
169
  input_variables=["schema", "question"],
170
  output_variables=["query", "python_graph", "json"],
171
  verbose=True,
 
182
  error_occurred = True
183
 
184
  if not error_occurred:
 
 
185
  st.write("## Generated Python")
186
  st.code(self.generated_python_code)
187
 
__pycache__/AI_generator.cpython-312.pyc CHANGED
Binary files a/__pycache__/AI_generator.cpython-312.pyc and b/__pycache__/AI_generator.cpython-312.pyc differ
 
app.py CHANGED
@@ -4,7 +4,7 @@ from AI_generator import SCHEMA_STR, SqlToPlotlyStreamlit
4
  from dashboard import dashboard
5
  from dotenv import load_dotenv
6
  import os
7
- import hashlib
8
 
9
  load_dotenv()
10
 
@@ -13,7 +13,8 @@ password = os.getenv("PASSWORD")
13
 
14
 
15
  st.sidebar.markdown("""
16
- <footer style="position: fixed; bottom: 0; text-align: center; background-color: #002b36; border-top: 1px solid #ddd;">
 
17
  &copy; 2023 LPO. All rights reserved.
18
  </footer>
19
  """, unsafe_allow_html=True)
 
4
  from dashboard import dashboard
5
  from dotenv import load_dotenv
6
  import os
7
+
8
 
9
  load_dotenv()
10
 
 
13
 
14
 
15
  st.sidebar.markdown("""
16
+ <footer style="position: fixed; bottom: 0; text-align: center;
17
+ background-color: #002b36; border-top: 1px solid #ddd;">
18
  &copy; 2023 LPO. All rights reserved.
19
  </footer>
20
  """, unsafe_allow_html=True)