ofermend commited on
Commit
1dd9de7
·
1 Parent(s): 7a31d5c
Files changed (5) hide show
  1. Dockerfile +3 -1
  2. agent.py +4 -3
  3. app.py +3 -0
  4. requirements.txt +3 -3
  5. st_app.py +1 -2
Dockerfile CHANGED
@@ -4,7 +4,9 @@ WORKDIR /app
4
 
5
  COPY ./requirements.txt /app/requirements.txt
6
 
7
- RUN pip3 install --no-cache-dir -r /app/requirements.txt
 
 
8
 
9
  # User
10
  RUN useradd -m -u 1000 user
 
4
 
5
  COPY ./requirements.txt /app/requirements.txt
6
 
7
+ RUN pip3 install --no-cache-dir --upgrade pip
8
+ RUN pip3 install --no-cache-dir wheel setuptools build
9
+ RUN pip3 install --no-cache-dir --use-pep517 -r /app/requirements.txt
10
 
11
  # User
12
  RUN useradd -m -u 1000 user
agent.py CHANGED
@@ -48,11 +48,11 @@ def create_assistant_tools(cfg):
48
  },
49
  {
50
  "type": "mmr",
51
- "diversity_bias": 0.4,
52
  "limit": 30
53
  }
54
  ],
55
- n_sentences_before = 2, n_sentences_after = 2, lambda_val = 0.005,
56
  vectara_summarizer = summarizer,
57
  include_citations = True,
58
  verbose=False
@@ -80,6 +80,7 @@ def initialize_agent(_cfg, agent_progress_callback=None):
80
  - For questions about customers' complaints (the text of the complaint), use the ask_complaints tool.
81
  You only need the query parameter to use this tool, but you can supply other parameters if provided.
82
  Do not include the "References" section in your response.
 
83
  - Never discuss politics, and always respond politely.
84
  """
85
 
@@ -89,7 +90,7 @@ def initialize_agent(_cfg, agent_progress_callback=None):
89
  custom_instructions=cfpb_complaints_bot_instructions,
90
  agent_progress_callback=agent_progress_callback
91
  )
92
- agent.report()
93
  return agent
94
 
95
 
 
48
  },
49
  {
50
  "type": "mmr",
51
+ "diversity_bias": 0.2,
52
  "limit": 30
53
  }
54
  ],
55
+ n_sentences_before = 2, n_sentences_after = 3, lambda_val = 0.005,
56
  vectara_summarizer = summarizer,
57
  include_citations = True,
58
  verbose=False
 
80
  - For questions about customers' complaints (the text of the complaint), use the ask_complaints tool.
81
  You only need the query parameter to use this tool, but you can supply other parameters if provided.
82
  Do not include the "References" section in your response.
83
+ - When using a company name with a tool, if the tool returns no information, try a difference variation of that company names, as well as different capitalization.
84
  - Never discuss politics, and always respond politely.
85
  """
86
 
 
90
  custom_instructions=cfpb_complaints_bot_instructions,
91
  agent_progress_callback=agent_progress_callback
92
  )
93
+ agent.report(detailed=False)
94
  return agent
95
 
96
 
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import os
2
 
3
  import streamlit as st
 
4
  from st_app import launch_bot
5
 
6
  import nest_asyncio
@@ -10,6 +11,8 @@ import uuid
10
  import sqlite3
11
  from datasets import load_dataset
12
 
 
 
13
  # Setup for HTTP API Calls to Amplitude Analytics
14
  if 'device_id' not in st.session_state:
15
  st.session_state.device_id = str(uuid.uuid4())
 
1
  import os
2
 
3
  import streamlit as st
4
+ import torch
5
  from st_app import launch_bot
6
 
7
  import nest_asyncio
 
11
  import sqlite3
12
  from datasets import load_dataset
13
 
14
+ torch.classes.__path__ = []
15
+
16
  # Setup for HTTP API Calls to Amplitude Analytics
17
  if 'device_id' not in st.session_state:
18
  st.session_state.device_id = str(uuid.uuid4())
requirements.txt CHANGED
@@ -1,10 +1,10 @@
1
  omegaconf==2.3.0
2
  python-dotenv==1.0.1
3
- streamlit==1.41.1
4
- streamlit_pills==0.3.0
5
  streamlit-feedback==0.1.3
6
  langdetect==1.0.9
7
  langcodes==3.4.0
8
  datasets==2.19.2
9
  uuid==1.30
10
- vectara-agentic==0.2.5
 
 
1
  omegaconf==2.3.0
2
  python-dotenv==1.0.1
3
+ streamlit==1.43.2
 
4
  streamlit-feedback==0.1.3
5
  langdetect==1.0.9
6
  langcodes==3.4.0
7
  datasets==2.19.2
8
  uuid==1.30
9
+ vectara-agentic==0.2.9
10
+ torch==2.6.0
st_app.py CHANGED
@@ -3,7 +3,6 @@ import sys
3
  import re
4
 
5
  import streamlit as st
6
- from streamlit_pills import pills
7
  from streamlit_feedback import streamlit_feedback
8
 
9
  from utils import thumbs_feedback, escape_dollars_outside_latex, send_amplitude_data
@@ -15,7 +14,7 @@ initial_prompt = "How can I help you today?"
15
 
16
  def show_example_questions():
17
  if len(st.session_state.example_messages) > 0 and st.session_state.first_turn:
18
- selected_example = pills("Queries to Try:", st.session_state.example_messages, index=None)
19
  if selected_example:
20
  st.session_state.ex_prompt = selected_example
21
  st.session_state.first_turn = False
 
3
  import re
4
 
5
  import streamlit as st
 
6
  from streamlit_feedback import streamlit_feedback
7
 
8
  from utils import thumbs_feedback, escape_dollars_outside_latex, send_amplitude_data
 
14
 
15
  def show_example_questions():
16
  if len(st.session_state.example_messages) > 0 and st.session_state.first_turn:
17
+ selected_example = st.pills("Queries to Try:", st.session_state.example_messages, default=None)
18
  if selected_example:
19
  st.session_state.ex_prompt = selected_example
20
  st.session_state.first_turn = False