bitft commited on
Commit
71625ed
·
verified ·
1 Parent(s): ab15836

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -9,7 +9,7 @@ from pandasai.llm.openai import OpenAI
9
  def main():
10
  st.set_page_config(layout='wide')
11
  st.title('Conversations with your vulnerability scans')
12
- st.sidebar.image("images/insight.jpg", use_column_width=True)
13
  print("===> ",st.chat_input)
14
  model = st.sidebar.selectbox(
15
  'Step1: Choose a model',
@@ -26,18 +26,24 @@ def main():
26
  message = None
27
  question_selected = None
28
  query_text = None
29
- # model = None
30
- # api_key = None
31
  with col1:
32
  st.markdown('Chat with the reports (CSV or Excel) and get Insights')
33
  chat = ""
34
  # Input widgets
35
  df_options = ["How many rows are there?", "Display the records related to XSS?", "Display the first 3 record", "Show Pie chart by all severity"]
36
  icons = ["","","",""]
37
- if uploaded_file and model and api_key:
 
38
  # initialize the model obj
39
  if model == 'gpt' and api_key:
40
  llm = OpenAI(api_token=api_key)
 
 
 
 
 
 
41
  else:
42
  llm = ChatGroq(model="llama3-8b-8192", api_key=api_key)
43
  # input
@@ -51,7 +57,6 @@ def main():
51
  else:
52
  st.warning("Please Upload CSV File to continue ...")
53
 
54
- #future plan
55
  with col2:
56
  pass
57
 
@@ -70,4 +75,4 @@ def main():
70
 
71
 
72
  if __name__ == "__main__":
73
- main()
 
9
  def main():
10
  st.set_page_config(layout='wide')
11
  st.title('Conversations with your vulnerability scans')
12
+ st.sidebar.image("./insight.jpg", use_column_width=True)
13
  print("===> ",st.chat_input)
14
  model = st.sidebar.selectbox(
15
  'Step1: Choose a model',
 
26
  message = None
27
  question_selected = None
28
  query_text = None
29
+
 
30
  with col1:
31
  st.markdown('Chat with the reports (CSV or Excel) and get Insights')
32
  chat = ""
33
  # Input widgets
34
  df_options = ["How many rows are there?", "Display the records related to XSS?", "Display the first 3 record", "Show Pie chart by all severity"]
35
  icons = ["","","",""]
36
+ print("==> ",model,uploaded_file)
37
+ if uploaded_file and api_key and model is not "None":
38
  # initialize the model obj
39
  if model == 'gpt' and api_key:
40
  llm = OpenAI(api_token=api_key)
41
+ elif model == 'llama3-8b-8192' and api_key:
42
+ llm = ChatGroq(model="llama3-8b-8192", api_key=api_key)
43
+ elif model == 'mixtral-8x7b-32768' and api_key:
44
+ llm = ChatGroq(model="llama3-8b-8192", api_key=api_key)
45
+ elif model == 'gemma-7b-it' and api_key:
46
+ llm = ChatGroq(model="llama3-8b-8192", api_key=api_key)
47
  else:
48
  llm = ChatGroq(model="llama3-8b-8192", api_key=api_key)
49
  # input
 
57
  else:
58
  st.warning("Please Upload CSV File to continue ...")
59
 
 
60
  with col2:
61
  pass
62
 
 
75
 
76
 
77
  if __name__ == "__main__":
78
+ main()