From a5f2f46992996a5a69cc3fe02053730e281c21ee Mon Sep 17 00:00:00 2001 From: sean1832 Date: Sun, 19 Mar 2023 16:15:33 +1100 Subject: [PATCH] fix: not able to re-run the process due to summary cache --- src/Components/sidebar.py | 11 ++++++----- src/util.py | 2 -- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Components/sidebar.py b/src/Components/sidebar.py index e172117..c937541 100644 --- a/src/Components/sidebar.py +++ b/src/Components/sidebar.py @@ -80,11 +80,12 @@ def sidebar(): 'Rephrase and restructure the text so that it can be read fluently, make sense ' \ 'and avoid repetition.' \ - default_persona_sum_b = 'identify five key points in the following transcript and use them as headings. ' \ - 'Use ### headings in markdown. ' \ - 'Under headings, provide detail explanation of the concept based on the following text ' \ - 'in the way that can be read fluently, make sense and avoid repetition. ' \ - 'Make sure to include all information. Write it in beautiful and structured markdown.' + default_persona_sum_b = 'identify headings in the transcript and summarise them into five ' \ + 'headings. Use #### headings in markdown. Under headings, summarise at least ' \ + '3 key points and then provide detail explanation of the concept based on the ' \ + 'following text in the way that can be read fluently, make sense and avoid ' \ + 'repetition. Make sure to include all information. Write it in beautiful and ' \ + 'structured markdown. ' persona_sum = st.text_area('Bot Persona Total Sum', value=_set_config(config_file, "OPENAI_PERSONA_SUM", default_persona_sum_b), diff --git a/src/util.py b/src/util.py index 247b7e9..9e6f88c 100644 --- a/src/util.py +++ b/src/util.py @@ -172,7 +172,6 @@ def search_chunks(query: str, chunks: List[Dict[str, float]], count: int = 1) -> return ordered[0:count] -@st.cache_data(show_spinner=False) def recursive_summarize(chunks: List[Dict[str, Union[str, float]]], max_tokens) -> Tuple[List[str], str]: """Returns a recursive summary of the given content.""" recursiveSumTexts = [] @@ -193,7 +192,6 @@ def recursive_summarize(chunks: List[Dict[str, Union[str, float]]], max_tokens) return recursiveSumTexts, finish_reason -@st.cache_data(show_spinner=False) def summarize(message: List[str] | str) -> Tuple[str, str]: """Returns a summary of the given content.""" if isinstance(message, list):