From 9af280843965bc46aec20d5b17aeb38136450615 Mon Sep 17 00:00:00 2001 From: Sam Borms Date: Sun, 22 Oct 2023 21:57:27 +0200 Subject: [PATCH] fix pydantic error 4 --- "webapp/pages/05_\360\237\223\243_Coachbot.py" | 6 +++--- webapp/queries.py | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git "a/webapp/pages/05_\360\237\223\243_Coachbot.py" "b/webapp/pages/05_\360\237\223\243_Coachbot.py" index 3b673e8..ab7e684 100644 --- "a/webapp/pages/05_\360\237\223\243_Coachbot.py" +++ "b/webapp/pages/05_\360\237\223\243_Coachbot.py" @@ -13,7 +13,7 @@ st.set_page_config(page_title="Coachbot", page_icon="📣", layout="wide") -@st.cache_resource() +# @st.cache_resource() def load_chain(input_openai_api_key=openai.api_key, context=""): """Configures a conversational chain for answering user questions.""" # load OpenAI's language model @@ -88,10 +88,10 @@ def prepare_prompt_team_context(dict_info): ) st.session_state["team"] = team - st.button("Let's chat!") + go = st.button("Let's chat!") # initialize navbar and chat window -else: +if go: with st.sidebar: with st.container(): st.success( diff --git a/webapp/queries.py b/webapp/queries.py index 4ad6471..65f7d66 100644 --- a/webapp/queries.py +++ b/webapp/queries.py @@ -31,7 +31,7 @@ def query_nbr_next_games(_conn, dates): return df -@st.cache_data +@st.cache_data(show_spinner=False) def query_teams(_conn): q = """ select @@ -70,7 +70,7 @@ def query_teams(_conn): return df -@st.cache_data +@st.cache_data(show_spinner=False) def query_players(_conn): q = """ select distinct @@ -91,7 +91,7 @@ def query_players(_conn): return df -@st.cache_data +@st.cache_data(show_spinner=False) def query_stats_agg(_conn): q = """ select distinct @@ -112,12 +112,12 @@ def query_stats_agg(_conn): return df -@st.cache_data +@st.cache_data(show_spinner=False) def query_list_teams(_conn): return _conn.query("select distinct team from teams;") -@st.cache_data +@st.cache_data(show_spinner=False) def query_schedule(_conn, team): q = f""" select @@ -133,7 +133,7 @@ def query_schedule(_conn, team): return df -@st.cache_data +@st.cache_data(show_spinner=False) def query_stats_players(_conn, team): q = f""" select @@ -151,7 +151,7 @@ def query_stats_players(_conn, team): return df -@st.cache_data +@st.cache_data(show_spinner=False) def query_standings(_conn, team): q = f""" select