Skip to content

Commit

Permalink
fix: not able to re-run the process due to summary cache
Browse files Browse the repository at this point in the history
  • Loading branch information
sean1832 committed Mar 19, 2023
1 parent a67cf39 commit a5f2f46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 6 additions & 5 deletions src/Components/sidebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 0 additions & 2 deletions src/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand All @@ -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):
Expand Down

0 comments on commit a5f2f46

Please sign in to comment.